vue webpack添加jQuery

Posted on 2018-04-02 17:36  金-Fish  阅读(385)  评论(0编辑  收藏  举报

---恢复内容开始---

在webpack.prod.conf.js文件中,找到plugins

 

 

 


new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
在plugins的数组中加入上列代码,并且在npm 中安装jquery
npm install jquery -S

---恢复内容结束---