Javascript 巴别塔7,IE>;9,网页包3,即ES6的语法错误
我无法获得箭头函数,甚至:Javascript 巴别塔7,IE>;9,网页包3,即ES6的语法错误,javascript,webpack,babeljs,babel-polyfill,Javascript,Webpack,Babeljs,Babel Polyfill,我无法获得箭头函数,甚至: ()=>1*1;使用Babel 7在IE 9和IE 11中工作,它在chrome中工作,在chrome中使用rest和destructuring,但以下内容在IE 9或IE 11中不工作,箭头函数,destructuring,rest 代码设置如下: package.json文件: devDependencies: "@babel/cli": "^7.1.0", "@babel/core": "^7.0.0", "@ba
()=>1*1;使用Babel 7在IE 9和IE 11中工作,它在chrome中工作,在chrome中使用rest和destructuring,但以下内容在IE 9或IE 11中不工作,箭头函数,destructuring,rest 代码设置如下: package.json文件:
devDependencies:
"@babel/cli": "^7.1.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-stage-0": "^7.0.0",
"@babel/preset-stage-3": "^7.0.0",
"babel-loader": "^8.0.0",
dependencies:
"@babel/polyfill": "^7.0.0"
Running with webpack 3.8.1.
.babelrc file is simply:
{
"presets": [
["@babel/preset-env", {
"targets": {
"browsers": ["ie >= 9"]
},
"esmodules": true,
"loose": true,
"debug": true,
"useBuiltIns": "entry"
}],
"@babel/preset-stage-0"],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-transform-object-assign",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings"
],
"ignore": [
"node_modules"
]
}
webpack.js文件:
webpack.js中的条目:
entry: {
commonThirdParty: ['@babel/polyfill', 'backbone', 'lodash'],
},
module: {
loaders: [{
test: /.js?$/,
include: odfPath,
exclude: /(node_modules|node)/,
use: [{
loader: 'babel-loader',
}]
}]
}
有没有人有什么想法,我如何才能让IE 9和IE 11接受传输到ES5的ES6代码以成功工作?“()=>1*1;在IE 9和IE 11中工作”与“以下内容在IE 9或IE 11中不工作,箭头函数”相反。它是哪一个?什么是
odfPath
?如果include
不包含中包含箭头函数的文件,则无法通过Babel。-箭头函数在IE 9和IE 11中不起作用,例如:()=>1*1;返回语法错误。odfPath是:比如:C:\path\to\design framework\src\ui有什么想法吗?