Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Babel和Vue.js时IE 11的脚本错误_Vue.js_Internet Explorer 11_Babeljs - Fatal编程技术网

使用Babel和Vue.js时IE 11的脚本错误

使用Babel和Vue.js时IE 11的脚本错误,vue.js,internet-explorer-11,babeljs,Vue.js,Internet Explorer 11,Babeljs,Windows 10/IE 11上的Vue.js应用程序出现问题 应用程序给出了SCRIPT1003:Expected':',直到我们将babel.config更新为以下内容: module.exports = { presets: [ [ '@vue/cli-plugin-babel/preset', { targets: { 'ie': '11' } } ] ] } 此时错误现在

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(113659311)
,它似乎与
vuelidate
节点模块有关

似乎我需要
排除上面的包,但我不明白语法应该放在哪里。
我还可能需要排除多个包


基本项目是使用vue cli 4.4.1构建的,配置文件还没有远离库存安装

是否要传输模块?您可以在
webpack.config.js
babel.config.js
中使用
exclude
属性来传输模块

您可以更改此行:

...
 exclude: /node_modules/,
...
为此:

...
  exclude: /node_modules\/(?!name-of-untranspiled-module)/,
...
如果需要排除多个模块,可以扩展例外列表,如下所示:

exclude: /node_modules\/(?![module1|module2])/

有关更多信息,请参阅。

谢谢,这正是我要找的。不幸的是,这并没有解决我所犯的错误。