ie 11下import(/* webpackChunkName:"lodash" */ "lodash") 打包运行报错

打包后在ie下运行报错的信息是:
Unhandled promise rejection TypeError: Target is not iterable
图片描述


我的配置:
{
“presets”: [
[
"@babel/preset-env",
{
“useBuiltIns”: “usage”,
// 这个 corejs 一定要配置,Babel在7.4.0以后想要安装corejs这个核心库
"corejs": {
“version”: 3
},
“targets”: {
“edge”: “17”,
“ie”: “11”,
“firefox”: “60”,
“chrome”: “67”,
“safari”: “11.1”
}
}
]
],
“plugins”: ["@babel/plugin-syntax-dynamic-import"]
}

我的代码
function getComponent() {
return import(/* webpackChunkName:“lodash” */ “lodash”).then(
({ default: _ }) => {
var element = document.createElement(“div”);
element.innerHTML = _.join([“hello”, “world”], “-”);
return element;
}
);
}

document.addEventListener(“click”, ()=>{
getComponent().then(element => {
document.body.appendChild(element);
});
});


特别平凡的人
浏览 1479回答 0
0回答

慕斯4360584

YEYOAXDAYREGDHAKMDSZMSOKTKJMJCLLLFRVOTCCWPMFXKWDURKXKQNOKULBXNGWYXZRUBXAATFMISLSCBOVVOKOOKEKGTJZCIGYHXXHQQZFPYPAKARVIRKRABKKHXTWPIIYUOOKFPTYHBZOWWJMPIFOJIONFEOERHKGACOOELVSLOKHQIFNJTCQQXXIORRLRKOYOUSOLMMCAEXVBGSFMWVHBRXXLUHPCVSLBJSJSZJCCFIBGJZFIYTJPYOFRSLOKBXMJVDSNJWXDDQTSPCOTJGJIPSKXTVRXYYIRECJCUDSMNOEXNDAVUBURAGWGEVROEEEKKXXDZEAXDTJXQWNHSEDTTZXDTUDMYEULSFORYUXCCOOVAXNIOJPIELKAWWVOLYRHAAUGDQMYRVRYOUDBMZRXHHXAHQWJORZFYVFCTWCSGVVBUBKRKXKTMDDAEUKRURXVTXXRHYHLHSLFMGEWMGJJDPVMXTGOYRHCSVKYYWGCJGSXZVGDKDXDPXTZDQRXEIVDTWQRBVIPWAJPDZWTNNUDQDSNRWDAZGZDQFKLHDJUEELBXKVVTKKTGIOJWBHVRNDWWQF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