Vue IE11报错

问题:
vue-cli3.0打包后用IE11打包报错
报错如下:
SCRIPT1006: 缺少 ')'
chunk-vendors.0e4045c9.js (221,12985)
Vue IE11报错
尝试解决的办法:
在网上百度的 都说要配置babel/polyfill,项目中已经下载,并且引用了
1.在main.js中引入了

import 'babel-polyfill';

2.在babel.config.js中配置了

module.exports = {

presets: [

[

'@vue/app', {

useBuiltIns: 'entry',

polyfills: [

'es6.promise',

'es6.symbol',

'es6.array.find-index',

'es7.array.includes',

'es6.string.includes',

]

},

]

]

};

3.package.json

"devDependencies": {

"@vue/cli-plugin-babel": "~4.4.0",

"@vue/cli-plugin-eslint": "~4.4.0",

"@vue/cli-plugin-router": "~4.4.0",

"@vue/cli-plugin-unit-jest": "~4.4.0",

"@vue/cli-plugin-vuex": "~4.4.0",

"@vue/cli-service": "~4.4.0",

"@vue/eslint-config-prettier": "^6.0.0",

"@vue/test-utils": "^1.0.3",

"babel-eslint": "^10.1.0",

"babel-polyfill": "^6.26.0",

"es6-promise": "^4.2.8",

"eslint": "^6.7.2",

"eslint-plugin-prettier": "^3.1.3",

"eslint-plugin-vue": "^6.2.2",

"less": "^3.0.4",

"less-loader": "^6.2.0",

"lint-staged": "^9.5.0",

"postcss-pxtorem": "^5.1.1",

"prettier": "^1.19.1",

"vue-template-compiler": "^2.6.11"

},

这么修改后打包到IE中还是报错,请问有大佬遇到过这种情况吗?

回答

看名字里有 vendor,应该是某个第三方库代码里还有 es6 语法的代码,在 babel 配置里给他加上去就行

以上是 Vue IE11报错 的全部内容, 来源链接: utcz.com/a/106463.html

回到顶部