1

I try to use IgGrid Ignite UI with Webpack but i have the flowing error :

TypeError: jQuery.ui is undefined

Despite i have the jquery and jquery_ui in my package.json

I found a solution to build jquery thanks to:

new webpack.ProvidePlugin({
            jQuery: 'jquery',
            $: 'jquery',
            jquery: 'jquery'
        })

but not Jquery-ui

Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100
Anouar Mokhtari
  • 2,084
  • 4
  • 23
  • 23

1 Answers1

2

Install jquery-ui-bundle package and include it to alias in webpack config alias:

{
  "jquery-ui": "jquery-ui/build/release.js",
  ...
Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100
dkamburov
  • 396
  • 1
  • 7
  • It doesn't work. however i installed two packages : jquery-ui and jquery-ui-bundle "jquery-ui": "^1.12.1", "jquery-ui-bundle": "^1.12.1",and alias add \n alias: { "jquery-ui": "jquery-ui/build/release.js", }, – Anouar Mokhtari Apr 19 '17 at 16:49
  • when i try to require jquery-ui in app.component.ts (require('jquery-ui');) i get this error when i compile with Webpack: ERROR in ./~/jquery-ui/build/release.js Module not found: Error: Can't resolve 'download.jqueryui.com/lib/package-1-12-themes' in '/home/anouar99pac/pyramidEnv/ihm_v2/ihm/static/app_ng2/node_modules/jquery-ui/build' @ ./~/jquery-ui/build/release.js 60:15-73 @ ./src/app/app.component.ts @ ./src/app/app.module.ts @ ./src/main.ts – Anouar Mokhtari Apr 19 '17 at 16:52
  • How about using jquery-ui-bundle in alias: alias: { 'jquery-ui': 'jquery-ui-bundle/jquery-ui.js' }, – dkamburov Apr 20 '17 at 12:27