问题描述:
在导入jQuery的时候,没找到index.js
,就直接在vue.config.js
中添加了,出现的下面的错误
原因:未知
解决方法:
在外层加上configureWebpack
const path = require('path')
var webpack = require('webpack')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"windows.jQuery": "jquery"
})
]
}
}
版权声明:本文为qq_22841387原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。