我有一个应用程序,必须在IE11中运行。
一些依赖性,如 宿雾 使用胖箭头(=>),我想在es5中锁定它们来转置它们。
我咨询了很多其他的帖子来解决这个问题,但是在我的情况下似乎没有任何工作。我的chunk-vendors.js文件经常有相同数量的胖箭头
以下是我目前的设置
babel.config.js
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
module.exports = {
presets: [
[
'@vue/cli-plugin-babel/preset',
{
"useBuiltIns": "entry"
}
]
]
}
vue.config.js
module.exports = {
filenameHashing: process.env.NODE_ENV !== 'production',
productionSourceMap: false,
transpileDependencies: ["lodash"]
}
软件包.json
...
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"ie 11"
]
}
...
我想你需要在你的代码根部使用下面的开始或core-js和regenerator
import "@babel/polyfill";
您还将使用预设的
babel-preset-env