3

请帮助解决这个问题。

在用于导入 jquery 插件的 angular2-webpack-starter中,我正在这样做:在 webpack.config 中,在 ProvidePlugin 中定义 jquery变量

jQuery:'jquery',$:'jquery',

... 等等。

在 ts 组件中,我正在导入插件,例如:

import 'jquery.backstretch'

一切正常,在 console.log 中显示了库。

你能帮忙在angular2 通用 webpack中做什么吗???

我也在做同样的事情,但是开始时

dist/server/index.js

它抛出错误

ReferenceError: jQuery is not defined
at Object.<anonymous> (/Users/artem/projects/universal-starter/node_modules/jquery.backstretch/jquery.backstretch.js:1472:3)
4

0 回答 0