diff --git a/packages/build-user-config/CHANGELOG.md b/packages/build-user-config/CHANGELOG.md index 855ceb2f30..4444c0cc5d 100644 --- a/packages/build-user-config/CHANGELOG.md +++ b/packages/build-user-config/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.2 + +- [fix] lazy import is invalid with swc + ## 2.0.1 - [fix] enhance alias for node_modules dependencies diff --git a/packages/build-user-config/package.json b/packages/build-user-config/package.json index daa03a8745..96fa41ef86 100644 --- a/packages/build-user-config/package.json +++ b/packages/build-user-config/package.json @@ -1,6 +1,6 @@ { "name": "@builder/user-config", - "version": "2.0.1", + "version": "2.0.2", "description": "Includes methods which are releated to set base user config for framework", "homepage": "", "license": "MIT", @@ -45,4 +45,4 @@ "bugs": { "url": "https://github.com/alibaba/ice/issues" } -} \ No newline at end of file +} diff --git a/packages/build-user-config/src/userConfig/swc.js b/packages/build-user-config/src/userConfig/swc.js index 52fb7eed7e..795d367c35 100644 --- a/packages/build-user-config/src/userConfig/swc.js +++ b/packages/build-user-config/src/userConfig/swc.js @@ -36,7 +36,9 @@ module.exports = (config, swcOptions, context, { log, getValue }) => { }, module: { type: 'commonjs', - noInterop: false + noInterop: false, + // webpack will evaluate dynamic import, so there need preserve it + ignoreDynamic: true }, env: { loose: true,