webpack 引用 jquery + bootstrap 报错解决
webpack 引用 jquery + bootstrap , error : jQuery is not defind 或者 $ is not defined
使用webpack中的plugins中使用ProvidePlugin这个插件进行全局变量注册
在webpack.conf.js plugins[] 加入
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
![](https://images2015.cnblogs.com/blog/751663/201703/751663-20170305174722595-646246700.png)
![](https://images2015.cnblogs.com/blog/751663/201703/751663-20170305174709923-1479840360.png)
posted on 2017-03-05 17:48 vok_think 阅读(2760) 评论(2) 编辑 收藏 举报