第一步:
安装babel-plugin-dynamic-import-node
yarn add(npm install) babel-plugin-dynamic-import-node --save
第二步:
修改babel.config.js文件
module.exports = {
presets: [
'@vue/app'
],
env: {
development: {
plugins: ['dynamic-import-node']
}
}
}
重新运行就可以了,亲测!!!!