如何在IE11中使用babel / webpack / corejs3正确捆绑?

问题描述

当前,输出导致IE11中的脚本语法错误。 (SCRIPT1002:语法错误

我的webpack设置如下。

{
  "name": "amp-test","version": "1.0.0","description": "","scripts": {
    "test": "echo \"Error: no test specified\" && exit 1","build": "babel src/js -d src","webpack-build": "webpack"
  },"keywords": [],"author": "","license": "ISC","devDependencies": {
    "@babel/cli": "^7.12.1","@babel/core": "^7.12.3","@babel/plugin-transform-runtime": "^7.12.1","@babel/preset-env": "^7.12.1","@babel/runtime": "^7.12.1","babel-loader": "^8.1.0","webpack": "^5.2.0","webpack-cli": "^4.1.0"
  },"dependencies": {
    "core-js": "^3.6.5"
  }
}

我对模块的依赖性如下。

// /dist/bundle.js

/******/ (() => { // webpackBootstrap
/******/    var __webpack_modules__ = ([
/* 0 */
/***/ ((module,__unused_webpack_exports,__webpack_require__) => {

__webpack_require__(1);
__webpack_require__(361);
var path = __webpack_require__(36);

module.exports = path;

...

我一直在寻找类似的问题并尝试,但是仍然没有得到想要的结果(How to use babel/corejs3/webpack correctly for IE11?

js bundled in the index.html file
<script src="./dist/bundle.js" defer></script>
It is imported and used in the above format.
For reference,it is not SPA,you can think of it as a static web.

如果查看上面的捆绑输出,则可以看到webpack引导以箭头功能开始。 我不知道为什么会出现箭头功能。 我非常需要专家的帮助。

np.where

谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)