2017-04-04 77 views
1

我尝试使用IgGrid点燃UI用的WebPack使用IgGrid,但我有流动的错误:jQuery.ui是不确定的,当我尝试使用的WebPack

类型错误:jQuery.ui未定义

尽管我有在我的package.json

的jQuery和jquery_ui我发现了一个解决方案来构建jQuery的感谢:

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

但不是jQuery的UI

回答

2

中安装jQuery UI的束包,它包括以别名的WebPack配置 别名:

{ 
    "jquery-ui": "jquery-ui/build/release.js", 
    ... 
+0

它不工作。但是我安装了两个软件包:jquery-ui和jquery-ui-bundle“jquery-ui”:“^ 1.12.1”,“jquery-ui-bundle”:“^ 1.12.1”和别名添加\ n别名: jquery-ui“:”jquery-ui/build/release.js“, }, –

+0

当我尝试要求app.component.ts中的jquery-ui(require('jquery-ui');)我在使用Webpack进行编译时遇到此错误:ERROR in ./~/jquery-ui/build/release.js 模块未找到:错误:无法解析'download.jqueryui.com/lib/package-1-12 '/ themes/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 –

+0

如何在别名中使用jquery-ui-bundle:别名:{ 'jquery-ui':'jquery-ui-bundle/jquery-ui.js' }, – dkamburov

相关问题