From 371627c78d31f636caf1338a15eb759cb547800a Mon Sep 17 00:00:00 2001 From: "gaoyuan.1226" Date: Wed, 27 Mar 2024 17:36:21 +0800 Subject: [PATCH 1/3] feat: enable newTreeShaking --- package.json | 2 + .../core/src/provider/plugins/transition.ts | 20 ++- pnpm-lock.yaml | 114 +++++++++--------- 3 files changed, 69 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 0eb187c3d5..c08a8a2e3e 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,8 @@ }, "pnpm": { "overrides": { + "@rspack/core": "0.5.9-canary-845e837-20240327011520", + "@rspack/plugin-react-refresh": "0.5.9-canary-845e837-20240327011520", "esbuild": "~0.19.0", "array.prototype.flat": "npm:@nolyfill/array.prototype.flat@1.0.24", "@rsbuild/core": "link:packages/core", diff --git a/packages/core/src/provider/plugins/transition.ts b/packages/core/src/provider/plugins/transition.ts index f0196dd0c2..f7865c9d66 100644 --- a/packages/core/src/provider/plugins/transition.ts +++ b/packages/core/src/provider/plugins/transition.ts @@ -6,22 +6,20 @@ import type { RsbuildPlugin } from '../../types'; export const pluginTransition = (): RsbuildPlugin => ({ name: 'rsbuild:transition', - setup() { + setup(api) { process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'; // improve kill process performance // https://github.com/web-infra-dev/rspack/pull/5486 process.env.WATCHPACK_WATCHER_LIMIT ||= '20'; - // api.modifyRspackConfig((config, { isProd }) => { - // only enable new tree shaking in production build, - // because Rspack still has some problems when using it in dev mode. - // such as https://github.com/web-infra-dev/rspack/issues/5887 - // if (isProd) { - // config.experiments ||= {}; - // config.experiments.rspackFuture ||= {}; - // config.experiments.rspackFuture.newTreeshaking = true; - // } - // }); + api.modifyRspackConfig((config) => { + // only enable new tree shaking in production build, + // because Rspack still has some problems when using it in dev mode. + // such as https://github.com/web-infra-dev/rspack/issues/5887 + config.experiments ||= {}; + config.experiments.rspackFuture ||= {}; + config.experiments.rspackFuture.newTreeshaking = true; + }); }, }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 15b91e18d5..0fc2082388 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,8 @@ settings: excludeLinksFromLockfile: false overrides: + '@rspack/core': 0.5.9-canary-845e837-20240327011520 + '@rspack/plugin-react-refresh': 0.5.9-canary-845e837-20240327011520 esbuild: ~0.19.0 array.prototype.flat: npm:@nolyfill/array.prototype.flat@1.0.24 '@rsbuild/core': link:packages/core @@ -667,7 +669,7 @@ importers: version: 11.1.0 html-webpack-plugin: specifier: npm:html-rspack-plugin@5.6.2 - version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9) + version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520) mini-css-extract-plugin: specifier: 2.8.1 version: 2.8.1(webpack@5.91.0) @@ -697,8 +699,8 @@ importers: specifier: workspace:* version: link:../shared '@rspack/core': - specifier: 0.5.9 - version: 0.5.9(@swc/helpers@0.5.3) + specifier: 0.5.9-canary-845e837-20240327011520 + version: 0.5.9-canary-845e837-20240327011520(@swc/helpers@0.5.3) '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -707,7 +709,7 @@ importers: version: 3.36.0 html-webpack-plugin: specifier: npm:html-rspack-plugin@5.6.2 - version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9) + version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520) postcss: specifier: ^8.4.38 version: 8.4.38 @@ -821,7 +823,7 @@ importers: version: 5.0.4 html-webpack-plugin: specifier: npm:html-rspack-plugin@5.6.2 - version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9) + version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520) terser: specifier: 5.29.2 version: 5.29.2 @@ -985,8 +987,8 @@ importers: specifier: link:../core version: link:../core '@rspack/core': - specifier: 0.5.9 - version: 0.5.9(@swc/helpers@0.5.3) + specifier: 0.5.9-canary-845e837-20240327011520 + version: 0.5.9-canary-845e837-20240327011520(@swc/helpers@0.5.3) '@scripts/test-helper': specifier: workspace:* version: link:../../scripts/test-helper @@ -1142,8 +1144,8 @@ importers: specifier: workspace:* version: link:../shared '@rspack/plugin-react-refresh': - specifier: 0.5.9 - version: 0.5.9(react-refresh@0.14.0) + specifier: 0.5.9-canary-845e837-20240327011520 + version: 0.5.9-canary-845e837-20240327011520(react-refresh@0.14.0) react-refresh: specifier: ^0.14.0 version: 0.14.0 @@ -1178,7 +1180,7 @@ importers: version: link:../../scripts/test-helper html-webpack-plugin: specifier: npm:html-rspack-plugin@5.6.2 - version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9) + version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520) typescript: specifier: ^5.4.2 version: 5.4.2 @@ -1503,8 +1505,8 @@ importers: packages/shared: dependencies: '@rspack/core': - specifier: 0.5.9 - version: 0.5.9(@swc/helpers@0.5.3) + specifier: 0.5.9-canary-845e837-20240327011520 + version: 0.5.9-canary-845e837-20240327011520(@swc/helpers@0.5.3) caniuse-lite: specifier: ^1.0.30001600 version: 1.0.30001600 @@ -1517,7 +1519,7 @@ importers: version: 16.18.84 html-webpack-plugin: specifier: npm:html-rspack-plugin@5.6.2 - version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9) + version: /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520) mini-css-extract-plugin: specifier: 2.8.1 version: 2.8.1(webpack@5.91.0) @@ -4715,84 +4717,84 @@ packages: dev: true optional: true - /@rspack/binding-darwin-arm64@0.5.9: - resolution: {integrity: sha512-IIClT4d5O7Ays6QrZG06eMYFYY4PwGpcRNChbeKkl3v+CgNshmsPHASnQ6HQjwilcnFw252Hb7ayz0IJGrArHQ==} + /@rspack/binding-darwin-arm64@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-pWKXWUNVNYUsO1ms4Nmzfy1mlkIGQuxElrZIXMviN/hGDKD8ZBSc3HuxpMwjqfAZttjvlcdYJclAKU5KDUBH4g==} cpu: [arm64] os: [darwin] requiresBuild: true optional: true - /@rspack/binding-darwin-x64@0.5.9: - resolution: {integrity: sha512-K3ijbHCR5ZgT69gR3LK8Zz9f+moMtqe87K7mu/6dms5n2eA/JrtZK/6qFaWKypgjySdwM6uNmff2FkJCJdRl/g==} + /@rspack/binding-darwin-x64@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-he7EBOTosaX+rFGyajrG9ew4Dq/pz0p4t3HkMNPB/72WcUP0q8M69PCnASgc68fsFQckmyf0o/O4KGzjQxCY7g==} cpu: [x64] os: [darwin] requiresBuild: true optional: true - /@rspack/binding-linux-arm64-gnu@0.5.9: - resolution: {integrity: sha512-sc0fp4CEt3sgafrDUV5hTLDErlarmsazPGkxdJPb5TGVYjiKaYxM6AtH1ZTEDP1DmDtCvBUutfbdO6pzXFDGSA==} + /@rspack/binding-linux-arm64-gnu@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-WTkxtPcBWLASFqUhHrXSUP1oaG88k0SLuxQG70hOcTG0itvIaJ+TiR24MIJuarZFdRpzw8DO2FA4lTUAKARxEQ==} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@rspack/binding-linux-arm64-musl@0.5.9: - resolution: {integrity: sha512-clhkNsNi76pTYtZz1U95R36AdZZH2eXbBWb0g17okCt4aXfJoHWIViDvHWvVmU9318repxwww3rR0ImbLskZiw==} + /@rspack/binding-linux-arm64-musl@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-8Rz+KvDLn+uB5Q3fbUnQ5RyG2qgG2jZ+UfVTab3qKFjjwD7vZYli/T0TYSd2f0aIvqed+QWST+rxgKZBsqw/UQ==} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@rspack/binding-linux-x64-gnu@0.5.9: - resolution: {integrity: sha512-bC69vwrG9R/kdpEuDXP/IleedCWR97d0GRLJFAapc2rPoFRI3vnuQVzp8+nX7CA1k2n6tfOJlOvaWLIik3hzXw==} + /@rspack/binding-linux-x64-gnu@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-WsOCixoUQcelJ4LDVS/RvmTUejFzsKTH9aD6Z5dDaEqWgF66qhSqht2zspAgeMcjZLPDHdfVNhLKiNhVqecFwA==} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@rspack/binding-linux-x64-musl@0.5.9: - resolution: {integrity: sha512-QGDcWKlLCunBW1/zIvPq6HkIt7920WVhY+ONFGd12owPUEveZTVxWYr64ROJqtIFueWFZYY4FFX6uwCpmH2hrQ==} + /@rspack/binding-linux-x64-musl@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-nl4FezYMG9B03tJY1T+bkX6n42DMic9rZ5rBf26mWkgnSnO0DfOHsiQ6c5PtbMSTDEgz3AgyAeLe9f8TrizpRg==} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@rspack/binding-win32-arm64-msvc@0.5.9: - resolution: {integrity: sha512-57ux9VmD4tIPBAM9G6cgGUjKX2AVLln+DJ3E2+OZV430w09NUoXmwt9THIm2cCaiExMlo0rZpgaEOsRbG1asBQ==} + /@rspack/binding-win32-arm64-msvc@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-50JSX7ni6YhsbtBELGMYzHPJbNOoBbsU3rN3KeN9WF4ANNFSBdx1C6WV54O1MzIZw873rJmRy/ZwfMuZOcv6OA==} cpu: [arm64] os: [win32] requiresBuild: true optional: true - /@rspack/binding-win32-ia32-msvc@0.5.9: - resolution: {integrity: sha512-DbV4fyZjvEZQi8lDttelP3ctvljfOc4rtElV0rFHzx78MCR7yBqhjLZwy0Y0x3x4SsVlxXyCAL1yXaUKL+Zoiw==} + /@rspack/binding-win32-ia32-msvc@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-rLn9nNgdkrSZkGdtDx3DfuX4NrqabWawAgzZGaZH9WIh5x6sX2Y8NIGDG+kcDdqOqJiB+ago5nP2x1P3xYFwaA==} cpu: [ia32] os: [win32] requiresBuild: true optional: true - /@rspack/binding-win32-x64-msvc@0.5.9: - resolution: {integrity: sha512-3FI/6hgsI/g42r+N2gfzs6k5P18X+3WcmT+VMX4Z3BvEi8L6nj6XlFRb/UOBac30/ohl435eEFVWjmyzdvS7Cw==} + /@rspack/binding-win32-x64-msvc@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-Y5sg4dU0gFDDmGsdB7L/yLRFFv+ZO/Xw+H6X8mQWlLO3a5aU1sl85ALkqwSqPppdbd+cR6B+6e1jUQevnSo5LQ==} cpu: [x64] os: [win32] requiresBuild: true optional: true - /@rspack/binding@0.5.9: - resolution: {integrity: sha512-6/+m+V3kf2CPmtB3DPziHdxJVxDi52Y3QRRH6bD5uvUtdS+Y48ICtvwUMREoC3yrZ5wCpe6j7J48iTLYn4toWQ==} + /@rspack/binding@0.5.9-canary-845e837-20240327011520: + resolution: {integrity: sha512-6iMhhtfHAIRfQxCK/p++k3kqvBDzc+X9xuymcZgMKLg7PglvSpgCGDIPyKlJsBlQXRua/o2Z0Zg7yKaEXPe6tA==} optionalDependencies: - '@rspack/binding-darwin-arm64': 0.5.9 - '@rspack/binding-darwin-x64': 0.5.9 - '@rspack/binding-linux-arm64-gnu': 0.5.9 - '@rspack/binding-linux-arm64-musl': 0.5.9 - '@rspack/binding-linux-x64-gnu': 0.5.9 - '@rspack/binding-linux-x64-musl': 0.5.9 - '@rspack/binding-win32-arm64-msvc': 0.5.9 - '@rspack/binding-win32-ia32-msvc': 0.5.9 - '@rspack/binding-win32-x64-msvc': 0.5.9 - - /@rspack/core@0.5.9(@swc/helpers@0.5.3): - resolution: {integrity: sha512-SNz6PS+LD5AFUnX75m5F1GULHPyoDx8v6A6zf5FQSF4CwZ+lGz47Fa2gRTTcQNXp3Fp+7v5m1q8TrSukV3yHwA==} + '@rspack/binding-darwin-arm64': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-darwin-x64': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-linux-arm64-gnu': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-linux-arm64-musl': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-linux-x64-gnu': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-linux-x64-musl': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-win32-arm64-msvc': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-win32-ia32-msvc': 0.5.9-canary-845e837-20240327011520 + '@rspack/binding-win32-x64-msvc': 0.5.9-canary-845e837-20240327011520 + + /@rspack/core@0.5.9-canary-845e837-20240327011520(@swc/helpers@0.5.3): + resolution: {integrity: sha512-8Bu1nlkbk1d8w42FSVdi4Hy1J9/QHEL4n+kl7SzzN/0/opY1fYr7QtJZ5ifIW1uiA034INaPlHubak1Q8ZFlyw==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -4801,7 +4803,7 @@ packages: optional: true dependencies: '@module-federation/runtime-tools': 0.0.8 - '@rspack/binding': 0.5.9 + '@rspack/binding': 0.5.9-canary-845e837-20240327011520 '@swc/helpers': 0.5.3 browserslist: 4.23.0 enhanced-resolve: 5.12.0 @@ -4815,8 +4817,8 @@ packages: zod: 3.22.4 zod-validation-error: 1.3.1(zod@3.22.4) - /@rspack/plugin-react-refresh@0.5.9(react-refresh@0.14.0): - resolution: {integrity: sha512-jsXA/8v4OaNLKo14+jqXKzAOKXWJs06ld6rzW97K9m2Q8hLd88jHiElxAgFsIiaSybu7tOs3ZKhhG/sGs4JspQ==} + /@rspack/plugin-react-refresh@0.5.9-canary-845e837-20240327011520(react-refresh@0.14.0): + resolution: {integrity: sha512-u7OFYVMfVrsVFT0UKZIj3Tfj3jYLvXmsTwXY8ut+xUrNsxS3QJ/Ve4SYvB166nDZJcxRSCs8QISM9ZahK/F3oQ==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' peerDependenciesMeta: @@ -7192,7 +7194,7 @@ packages: resolution: {integrity: sha512-LTSA/jWbwdMlk+rhmElbDR2vbtQoTBPr7fkJE+mxrHj+7ru0hUmHafDRzWIjIHTwpitWVaqY2/UWGRca3yUgRw==} engines: {node: '>= 12.13.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 webpack: ^5.0.0 peerDependenciesMeta: '@rspack/core': @@ -8892,16 +8894,16 @@ packages: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /html-rspack-plugin@5.6.2(@rspack/core@0.5.9): + /html-rspack-plugin@5.6.2(@rspack/core@0.5.9-canary-845e837-20240327011520): resolution: {integrity: sha512-cPGwV3odvKJ7DBAG/DxF5e0nMMvBl1zGfyDciT2xMETRrIwajwC7LtEB3cf7auoGMK6xJOOLjWJgaKHLu/FzkQ==} engines: {node: '>=10.13.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 peerDependenciesMeta: '@rspack/core': optional: true dependencies: - '@rspack/core': 0.5.9(@swc/helpers@0.5.3) + '@rspack/core': 0.5.9-canary-845e837-20240327011520(@swc/helpers@0.5.3) lodash: 4.17.21 tapable: 2.2.1 @@ -9558,7 +9560,7 @@ packages: resolution: {integrity: sha512-MYUxjSQSBUQmowc0l5nPieOYwMzGPUaTzB6inNW/bdPEG9zOL3eAAD1Qw5ZxSPk7we5dMojHwNODYMV1hq4EVg==} engines: {node: '>= 18.12.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 less: ^3.5.0 || ^4.0.0 webpack: ^5.0.0 peerDependenciesMeta: @@ -11802,7 +11804,7 @@ packages: resolution: {integrity: sha512-0IeqyAsG6tYiDRCYKQJLAmgQr47DX6N7sFSWvQxt6AcupX8DIdmykuk/o/tx0Lze3ErGHJEp5OSRxrelC6+NdQ==} engines: {node: '>= 18.12.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 postcss: ^7.0.0 || ^8.0.1 webpack: ^5.0.0 peerDependenciesMeta: @@ -12928,7 +12930,7 @@ packages: resolution: {integrity: sha512-QX8AasDg75monlybel38BZ49JP5Z+uSKfKwF2rO7S74BywaRmGQMUBw9dtkS+ekyM/QnP+NOrRYq8ABMZ9G8jw==} engines: {node: '>= 18.12.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 sass: ^1.3.0 sass-embedded: '*' @@ -13465,7 +13467,7 @@ packages: resolution: {integrity: sha512-+Xcn5fd0azjzSXxclT31wVviXlXbBfcBamFgAQimN2qug9ZQf0OmRlK+/MJwLs1V8DJWhTFGuFwmOTkfV4KnYQ==} engines: {node: '>= 18.12.0'} peerDependencies: - '@rspack/core': 0.x || 1.x + '@rspack/core': 0.5.9-canary-845e837-20240327011520 stylus: '>=0.52.4' webpack: ^5.0.0 peerDependenciesMeta: From feed5425db1cc90b253e14eef8b76fcc359914ee Mon Sep 17 00:00:00 2001 From: "gaoyuan.1226" Date: Wed, 27 Mar 2024 17:37:55 +0800 Subject: [PATCH 2/3] fix: update comment --- packages/core/src/provider/plugins/transition.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/provider/plugins/transition.ts b/packages/core/src/provider/plugins/transition.ts index f7865c9d66..9272caf571 100644 --- a/packages/core/src/provider/plugins/transition.ts +++ b/packages/core/src/provider/plugins/transition.ts @@ -14,9 +14,7 @@ export const pluginTransition = (): RsbuildPlugin => ({ process.env.WATCHPACK_WATCHER_LIMIT ||= '20'; api.modifyRspackConfig((config) => { - // only enable new tree shaking in production build, - // because Rspack still has some problems when using it in dev mode. - // such as https://github.com/web-infra-dev/rspack/issues/5887 + // rspack will be enabled by default in the next minor version config.experiments ||= {}; config.experiments.rspackFuture ||= {}; config.experiments.rspackFuture.newTreeshaking = true; From 300641782ede7d99f2e6ccc70fe75e8d3863279c Mon Sep 17 00:00:00 2001 From: "gaoyuan.1226" Date: Fri, 29 Mar 2024 11:28:05 +0800 Subject: [PATCH 3/3] fix: snapshot --- .../core/tests/__snapshots__/builder.test.ts.snap | 3 +++ .../core/tests/__snapshots__/default.test.ts.snap | 12 ++++++++++++ .../tests/__snapshots__/index.test.ts.snap | 3 +++ 3 files changed, 18 insertions(+) diff --git a/packages/core/tests/__snapshots__/builder.test.ts.snap b/packages/core/tests/__snapshots__/builder.test.ts.snap index 21d1d37c08..c4835eb480 100644 --- a/packages/core/tests/__snapshots__/builder.test.ts.snap +++ b/packages/core/tests/__snapshots__/builder.test.ts.snap @@ -20,6 +20,9 @@ exports[`should use rspack as default bundler > apply rspack correctly 1`] = ` }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error", diff --git a/packages/core/tests/__snapshots__/default.test.ts.snap b/packages/core/tests/__snapshots__/default.test.ts.snap index 5822df819c..3075acc704 100644 --- a/packages/core/tests/__snapshots__/default.test.ts.snap +++ b/packages/core/tests/__snapshots__/default.test.ts.snap @@ -20,6 +20,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = ` }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error", @@ -721,6 +724,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error", @@ -1487,6 +1493,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error", @@ -1903,6 +1912,9 @@ exports[`tools.rspack > should match snapshot 1`] = ` }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error", diff --git a/packages/plugin-react/tests/__snapshots__/index.test.ts.snap b/packages/plugin-react/tests/__snapshots__/index.test.ts.snap index d802d8d38f..ba7f8ac12b 100644 --- a/packages/plugin-react/tests/__snapshots__/index.test.ts.snap +++ b/packages/plugin-react/tests/__snapshots__/index.test.ts.snap @@ -37,6 +37,9 @@ exports[`plugins/react > should work with swc-loader 1`] = ` }, "experiments": { "asyncWebAssembly": true, + "rspackFuture": { + "newTreeshaking": true, + }, }, "infrastructureLogging": { "level": "error",