在webpack.base.conf.js中添加
{
test: /\.js$/,
// 对js文件使用babel-loader转码,该插件是用来解析es6等代码
loader: 'babel-loader',//注意elementUI的源码使用ES6需要解析
include: [resolve('src'), resolve('test'), resolve('/node_modules/vue-lazyload'), resolve('/node_modules/dist'), resolve('/node_modules/@vant/popperjs/dist')]
},
{
test: /\.mjs$/,
// 对js文件使用babel-loader转码,该插件是用来解析es6等代码
loader: 'babel-loader',//注意elementUI的源码使用ES6需要解析
include: resolve('/node_modules/@vant/popperjs/dist'),
},