Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

某些情况下bablePlugin失效 #7018

Open
aak1247 opened this issue Nov 11, 2024 · 1 comment
Open

某些情况下bablePlugin失效 #7018

aak1247 opened this issue Nov 11, 2024 · 1 comment
Labels

Comments

@aak1247
Copy link

aak1247 commented Nov 11, 2024

Describe the bug

间接依赖中使用了高版本axios,用到async generator语法,开启minify后 esbuild无法transform

Expected behavior

正常编译

Actual behavior

ERR! WEBPACK HookWebpackError: Transform failed with 2 errors:
ERR! WEBPACK js/index.4f8396b638781611c0d7.js:183158:18: ERROR: Transforming async generator functions to the configured target environment ("es2016") is not supported yet
ERR! WEBPACK js/index.4f8396b638781611c0d7.js:183164:19: ERROR: Transforming async generator functions to the configured target environment ("es2016") is not supported yet
ERR! WEBPACK     at makeWebpackError (D:\xxxx\node_modules\.pnpm\@[email protected]\node_modules\@builder\pack\deps\webpack\bundle5.js:68022:9)
ERR! WEBPACK     at D:\xxxx\node_modules\.pnpm\@[email protected]\node_modules\@builder\pack\deps\webpack\bundle5.js:51531:12   
ERR! WEBPACK     at eval (eval at create (D:\xxxx\node_modules\.pnpm\@[email protected]\node_modules\@builder\pack\deps\webpack\bundle5.js:40256:10), <anonymous>:68:1)
ERR! WEBPACK     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Version of ice.js

2.6.6

Content of build.json or ice.config.mts

{
  "eslint": true,
  "store": true,
  "dropLogLevel": "log",
  "hash": "contenthash",
  "modeConfig": {
    "dev": {
      "sourceMap": true
    },
    "test": {
      "sourceMap": true
    },
    "uat": {
      "sourceMap": true
    }
  },
  "minify": {
    "type": "esbuild",
    "options": {
      "target": "es2016",
      "css": true
    }
  },
  "plugins": [
    [
      "build-plugin-antd",
      {
        "themeConfig": {
          "primary-color": "#205FED"
        }
      }
    ],
    [
      "build-plugin-moment-locales",
      {
        "locales": ["zh-cn"]
      }
    ],
    [
      "build-plugin-icestark",
      {
        "uniqueName": "frameworkJsonp"
      }
    ],
    "./build.plugin.js"
  ],
  "babelPresets": [["@babel/preset-react", { "runtime": "automatic" }]],
  "babelPlugins": [
    "@babel/plugin-proposal-async-generator-functions"
  ],
  "compileDependencies": ["axios"],
  "browserslist": {
    "chrome": 49,
    "ie": 11
  }
}

Additional context

No response

@aak1247 aak1247 added the bug label Nov 11, 2024
@aak1247 aak1247 changed the title 某些情况下 某些情况下芭贝拉Plugin、 Nov 11, 2024
@aak1247 aak1247 changed the title 某些情况下芭贝拉Plugin、 某些情况下bablePlugin失效 Nov 12, 2024
@ClarkXia
Copy link
Collaborator

提供个复现 case 看下,看配置应该已经编译了 axios 了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants