我们在Windows 10 / IE 11上的Vue.js应用程序遇到问题。
应用程序给出SCRIPT1003: Expected ':'
,直到我们将babel.config
更新为以下内容:
module.exports = {
presets: [
[
'@vue/cli-plugin-babel/preset',
{
targets: {
'ie': '11'
}
}
]
]
}
此时错误是SCRIPT1002: Synxax Error chunk-vendors.js (11365, 9311)
,似乎与vuelidate
节点模块有关。
似乎我需要exclude
以上程序包,但我不知道语法应该在哪里。还有可能我需要排除多个软件包。
基础项目是使用vue-cli 4.4.1
构建的,并且配置文件离库存安装位置还差得远
您要移植模块吗?您可以使用exclude
或webpack.config.js
中的babel.config.js
属性来转换模块。
您可以更改此行:
...
exclude: /node_modules/,
...
进入此:
...
exclude: /node_modules\/(?!name-of-untranspiled-module)/,
...
如果需要排除多个模块,可以像下面这样扩展异常列表:
exclude: /node_modules\/(?![module1|module2])/
有关更多信息,您可以参考this link。