我正在为我的反应应用程序使用babel-preset-env 版本 - 1.6.1,我在 IE 上收到错误:-对象不支持属性或方法“分配”
这是我的.babelrc :-
{
"presets": [
"react",
[
"env",
{
"targets": {
"browsers": [
"last 1 versions",
"ie >= 11"
]
},
"debug": true,
"modules": "commonjs"
}
]
],
"env": {
"test": {
"presets": [
[
"babel-preset-env",
"react"
]
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"transform-runtime",
"babel-plugin-dynamic-import-node",
"array-includes",
"url-search-params-polyfill",
"transform-object-assign"
]
}
},
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"syntax-dynamic-import",
"transform-runtime",
"array-includes",
"url-search-params-polyfill",
"transform-object-assign"
]
}
我尝试了这些填充物:-
https://babeljs.io/docs/plugins/transform-object-assign/ https://www.npmjs.com/package/babel-plugin-object-assign
但它没有用
我正在使用语法:-
let a = Object.assign({},obj);
在我的项目中无处不在
我需要一个适用于我的项目的 polyfill。