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"
})
 

 

posted on 2017-03-05 17:48  vok_think  阅读(2760)  评论(2编辑  收藏  举报

导航