From 57fb181f1c2256d267dadffa66ccc418963bbc62 Mon Sep 17 00:00:00 2001 From: Wei Date: Wed, 25 Dec 2024 15:43:35 +0800 Subject: [PATCH 1/6] fix: adapt @rspack/core 1.1.9 (#602) --- package.json | 1 + packages/core/src/config.ts | 1 + .../tests/__snapshots__/config.test.ts.snap | 1 + pnpm-lock.yaml | 200 ++++++++++-------- .../alias/__snapshots__/index.test.ts.snap | 4 +- tests/integration/alias/index.test.ts | 2 +- .../asset/__snapshots__/index.test.ts.snap | 48 ++--- tests/integration/auto-external/index.test.ts | 2 +- .../__snapshots__/index.test.ts.snap | 12 +- tests/integration/bundle-false/index.test.ts | 16 +- .../__snapshots__/index.test.ts.snap | 24 +-- tests/integration/externals/index.test.ts | 2 +- tests/integration/format/index.test.ts | 4 +- tests/integration/minify/index.test.ts | 42 ++-- tests/integration/redirect/js.test.ts | 62 +++--- tests/integration/require/index.test.ts | 8 +- tests/integration/resolve/index.test.ts | 4 +- tests/integration/shims/index.test.ts | 4 +- .../transform-import/index.test.ts | 6 +- 19 files changed, 224 insertions(+), 219 deletions(-) diff --git a/package.json b/package.json index 08fcded3b..61cd3a11b 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ }, "pnpm": { "overrides": { + "@rspack/core": "npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751", "zx>@types/node": "-" } } diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 43962e1a2..ada1ac244 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -543,6 +543,7 @@ const composeFormatConfig = ({ optimization: { concatenateModules: true, sideEffects: 'flag', + avoidEntryIife: true, }, output: { module: true, diff --git a/packages/core/tests/__snapshots__/config.test.ts.snap b/packages/core/tests/__snapshots__/config.test.ts.snap index 7f2f724d1..65289ae66 100644 --- a/packages/core/tests/__snapshots__/config.test.ts.snap +++ b/packages/core/tests/__snapshots__/config.test.ts.snap @@ -189,6 +189,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "__filename": false, }, "optimization": { + "avoidEntryIife": true, "concatenateModules": true, "sideEffects": "flag", }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f4e751a2..97aea1c12 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: + '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 zx>@types/node: '-' importers: @@ -88,7 +89,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rsbuild/core': specifier: ~1.1.13 version: 1.1.13 @@ -109,13 +110,13 @@ importers: devDependencies: '@module-federation/enhanced': specifier: ^0.8.6 - version: 0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + version: 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@module-federation/storybook-addon': specifier: ^3.0.17 - version: 3.0.17(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1) + version: 3.0.17(@rsbuild/core@1.1.13)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1) '@rsbuild/plugin-react': specifier: ^1.1.0 version: 1.1.0(@rsbuild/core@1.1.13) @@ -139,10 +140,10 @@ importers: version: 8.4.7(prettier@3.4.2) storybook-addon-rslib: specifier: ^0.1.6 - version: 0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2) + version: 0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2) storybook-react-rsbuild: specifier: ^0.1.6 - version: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1) + version: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1) examples/module-federation/mf-remote: dependencies: @@ -155,7 +156,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rsbuild/core': specifier: ~1.1.13 version: 1.1.13 @@ -273,7 +274,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -395,7 +396,7 @@ importers: version: 4.0.0(vite@5.3.3(@types/node@22.8.1)(terser@5.31.6))(vitest@2.1.8(@types/node@22.8.1)(terser@5.31.6)) '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@playwright/test': specifier: 1.49.1 version: 1.49.1 @@ -1608,6 +1609,9 @@ packages: webpack: optional: true + '@module-federation/error-codes@0.8.4': + resolution: {integrity: sha512-55LYmrDdKb4jt+qr8qE8U3al62ZANp3FhfVaNPOaAmdTh0jHdD8M3yf5HKFlr5xVkVO4eV/F/J2NCfpbh+pEXQ==} + '@module-federation/error-codes@0.8.6': resolution: {integrity: sha512-xp2XYaJOdVUkyiogSDYnnD3EoT9SG8sPo1Z5ixX9EAZ3mNC9nosQx23I48rG57lMNtm3YrWpaG9THr6q2LRABA==} @@ -1632,7 +1636,7 @@ packages: '@module-federation/rspack@0.8.6': resolution: {integrity: sha512-DAZ41bthtZ4hqGXreov2VRs+bM6ee5O2mzI1OTjZv0zQZpaTEAEJJ4JU6ei4BWYAN0A7YIuM9HPPUtkQISdvVw==} peerDependencies: - '@rspack/core': '>=0.7' + '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 typescript: ^4.9.0 || ^5.0.0 vue-tsc: '>=1.0.24' peerDependenciesMeta: @@ -1641,20 +1645,20 @@ packages: vue-tsc: optional: true - '@module-federation/runtime-tools@0.5.1': - resolution: {integrity: sha512-nfBedkoZ3/SWyO0hnmaxuz0R0iGPSikHZOAZ0N/dVSQaIzlffUo35B5nlC2wgWIc0JdMZfkwkjZRrnuuDIJbzg==} + '@module-federation/runtime-tools@0.8.4': + resolution: {integrity: sha512-fjVOsItJ1u5YY6E9FnS56UDwZgqEQUrWFnouRiPtK123LUuqUI9FH4redZoKWlE1PB0ir1Z3tnqy8eFYzPO38Q==} '@module-federation/runtime-tools@0.8.6': resolution: {integrity: sha512-QAqgx8SaJHpSDd8OYqD1wAuhHHAvNPoUcL80g6+iWZSbcHJfxzkdB5tNGBBHQ0meiizV8xKfQjlyYu5YQjhAcA==} - '@module-federation/runtime@0.5.1': - resolution: {integrity: sha512-xgiMUWwGLWDrvZc9JibuEbXIbhXg6z2oUkemogSvQ4LKvrl/n0kbqP1Blk669mXzyWbqtSp6PpvNdwaE1aN5xQ==} + '@module-federation/runtime@0.8.4': + resolution: {integrity: sha512-yZeZ7z2Rx4gv/0E97oLTF3V6N25vglmwXGgoeju/W2YjsFvWzVtCDI7zRRb0mJhU6+jmSM8jP1DeQGbea/AiZQ==} '@module-federation/runtime@0.8.6': resolution: {integrity: sha512-KaXuESJ+2xDAdQcMG679PQi+TKjmN8SC+UJvYaYljjoTkqxL1brMHuk5zXYR1lC2e+KRgFGL0R8324H8H1BZ5w==} - '@module-federation/sdk@0.5.1': - resolution: {integrity: sha512-exvchtjNURJJkpqjQ3/opdbfeT2wPKvrbnGnyRkrwW5o3FH1LaST1tkiNviT6OXTexGaVc2DahbdniQHVtQ7pA==} + '@module-federation/sdk@0.8.4': + resolution: {integrity: sha512-waABomIjg/5m1rPDBWYG4KUhS5r7OUUY7S+avpaVIY/tkPWB3ibRDKy2dNLLAMaLKq0u+B1qIdEp4NIWkqhqpg==} '@module-federation/sdk@0.8.6': resolution: {integrity: sha512-cUhLGXmwCWGb5b7TKoVM2qJdMvcoJKggV6qsH3NYk5Gm9RJmYutAFRXN6lGeHXjbsDXVCzV5h6gOnU5dk84yWg==} @@ -1691,8 +1695,8 @@ packages: '@module-federation/third-party-dts-extractor@0.8.6': resolution: {integrity: sha512-0aZjeBuiETPGF2e4tbPjl97G/AYrViRg/NuIPXqtYjgQQdJ8Cunog8fBad7MZ1WXOfr1HVTnjmM+oXSnOvEI3g==} - '@module-federation/webpack-bundler-runtime@0.5.1': - resolution: {integrity: sha512-mMhRFH0k2VjwHt3Jol9JkUsmI/4XlrAoBG3E0o7HoyoPYv1UFOWyqAflfANcUPgbYpvqmyLzDcO+3IT36LXnrA==} + '@module-federation/webpack-bundler-runtime@0.8.4': + resolution: {integrity: sha512-HggROJhvHPUX7uqBD/XlajGygMNM1DG0+4OAkk8MBQe4a18QzrRNzZt6XQbRTSG4OaEoyRWhQHvYD3Yps405tQ==} '@module-federation/webpack-bundler-runtime@0.8.6': resolution: {integrity: sha512-LoHeoHq5PzjiY7CrTjstb4rom1myMj2cgsQMEBQNV7Gacpumu4WeEqjL2USK4d+OaaXLSpAdIZBktDT8UiWqOQ==} @@ -1958,56 +1962,56 @@ packages: typescript: optional: true - '@rspack/binding-darwin-arm64@1.1.8': - resolution: {integrity: sha512-I7avr471ghQ3LAqKm2fuXuJPLgQ9gffn5Q4nHi8rsukuZUtiLDPfYzK1QuupEp2JXRWM1gG5lIbSUOht3cD6Ug==} + '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-PyNHii4EFpyp+MkLlTN2RsRS0fqGjDSX3MJ6I6jIh2SSYFKkeu3MwMVs4pCH1YkWQezSgqXoT9a8LXRCEGwWIw==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.1.8': - resolution: {integrity: sha512-vfqf/c+mcx8rr1M8LnqKmzDdnrgguflZnjGerBLjNerAc+dcUp3lCvNxRIvZ2TkSZZBW8BpCMgjj3n70CZ4VLQ==} + '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-p7hrgYiLmiLaVAUipVaVRr35KsNmUx4WH/kCna6Y29h+5ySltmNmHTCU3WCrrkwIsEzj/3z5EDio2aKiIS5dCA==} cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@1.1.8': - resolution: {integrity: sha512-lZlO/rAJSeozi+qtVLkGSXfe+riPawCwM4FsrflELfNlvvEXpANwtrdJ+LsaNVXcgvhh50ZX2KicTdmx9G2b6Q==} + '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-vlsGKGV99jApjyAR44+4NwIpIngphrHntCiylkqE6XtjlNIR91uTen3YHQ+rUhxJHyJcFkfUc3XeR6NyLiIx7w==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.1.8': - resolution: {integrity: sha512-bX7exULSZwy8xtDh6Z65b6sRC4uSxGuyvSLCEKyhmG6AnJkg0gQMxk3hoO0hWnyGEZgdJEn+jEhk0fjl+6ZRAQ==} + '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-U6IZ0U/iNjh1LA1Cw4mwIoKlC0AX5NzLRKEpsMs2lPLOnVnZAxhl3uwnyuXjr/vAYqhfeH4H0H2PlnVx8YQNWQ==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.1.8': - resolution: {integrity: sha512-2Prw2USgTJ3aLdLExfik8pAwAHbX4MZrACBGEmR7Vbb56kLjC+++fXkciRc50pUDK4JFr1VQ7eNZrJuDR6GG6Q==} + '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-bhSJHsCmmcTk4OL/iGYYSjSktdTxiWcWAt7q9u3bkI+SSjue+0b1IvLMV23InziEKWaI/QuJ+SZEJoll6SjAtw==} cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.1.8': - resolution: {integrity: sha512-bnVGB/mQBKEdzOU/CPmcOE3qEXxGOGGW7/i6iLl2MamVOykJq8fYjL9j86yi6L0r009ja16OgWckykQGc4UqGw==} + '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-8kBQFMJ3S8FfHXu5E/dDHyRfx+o3ELUDlAPw7RRkgIE8a89fKyHNdMjs6w1fLpF/xjyE/v9i4RRfPQENH74VHg==} cpu: [x64] os: [linux] - '@rspack/binding-win32-arm64-msvc@1.1.8': - resolution: {integrity: sha512-u+na3gxhzeksm4xZyAzn1+XWo5a5j7hgWA/KcFPDQ8qQNkRknx4jnQMxVtcZ9pLskAYV4AcOV/AIximx7zvv8A==} + '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-pj10jbsjQ4vXCz2hVDky6yaKYaJ26Pzhj5yfrbZBxbDPyklcNYTnfXKAUB6QwSgpQ3choKcAzWvhm3fDcjD2/w==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.1.8': - resolution: {integrity: sha512-FijUxym1INd5fFHwVCLuVP8XEAb4Sk1sMwEEQUlugiDra9ZsLaPw4OgPGxbxkD6SB0DeUz9Zq46Xbcf6d3OgfA==} + '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-iCx7UzCQ1dnHRPBubqJj5P+NBkRMNLH3NHe1GScPEKkFIIO3CROA6m+f6lrRcrzeIl3XMlS9rfkuvjKUNFLRBw==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.1.8': - resolution: {integrity: sha512-SBzIcND4qpDt71jlu1MCDxt335tqInT3YID9V4DoQ4t8wgM/uad7EgKOWKTK6vc2RRaOIShfS2XzqjNUxPXh4w==} + '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-XijlB3KlSq/avhknTDrHlTDDr4eLuGSa7hxPDVaQIcuhWCCAHEmfniknk6a1DL6DzLwvBqIH8Yz8vqQu/urd8Q==} cpu: [x64] os: [win32] - '@rspack/binding@1.1.8': - resolution: {integrity: sha512-+/JzXx1HctfgPj+XtsCTbRkxiaOfAXGZZLEvs7jgp04WgWRSZ5u97WRCePNPvy+sCfOEH/2zw2ZK36Z7oQRGhQ==} + '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-wQc5r9FrbdliLLKZGNJ24FRumVtuUJfnMa0Os90B1gqPA1oBwF+CSTSOZ+AWDCfpiXjbSxchLyIgYpdaStZdXg==} - '@rspack/core@1.1.8': - resolution: {integrity: sha512-pcZtcj5iXLCuw9oElTYC47bp/RQADm/MMEb3djHdwJuSlFWfWPQi5QFgJ/lJAxIW9UNHnTFrYtytycfjpuoEcA==} + '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751': + resolution: {integrity: sha512-IjW+6VVUFbranhLkbLBrFGQYsoPCYW+JgOFmYADdq+qzLjhm7W+4NNsP4l47EG3K9EsWWppA/H8iYMnKQNjjXg==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -4208,6 +4212,10 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} + isomorphic-rslog@0.0.6: + resolution: {integrity: sha512-HM0q6XqQ93psDlqvuViNs/Ea3hAyGDkIdVAHlrEocjjAwGrs1fZ+EdQjS9eUPacnYB7Y8SoDdSY3H8p3ce205A==} + engines: {node: '>=14.17.6'} + isomorphic-rslog@0.0.7: resolution: {integrity: sha512-n6/XnKnZ5eLEj6VllG4XmamXG7/F69nls8dcynHyhcTpsPUYgcgx4ifEaCo4lQJ2uzwfmIT+F0KBGwBcMKmt5g==} engines: {node: '>=14.17.6'} @@ -6059,7 +6067,7 @@ packages: resolution: {integrity: sha512-K5BUrytoFju1Olu11T49vlYvDEGOguBF1CBCl4o2ARxDGPoJHHf7fBzLlK0YYkUqI5EFA5cMRUC6332M7hQBHw==} engines: {node: '>=16.0.0'} peerDependencies: - '@rspack/core': ^1.0.0 + '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 typescript: '>=3.8.0' peerDependenciesMeta: '@rspack/core': @@ -7287,14 +7295,14 @@ snapshots: - supports-color - utf-8-validate - '@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1)': + '@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1)': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.8.6 '@module-federation/data-prefetch': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@module-federation/dts-plugin': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/managers': 0.8.6 '@module-federation/manifest': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) - '@module-federation/rspack': 0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) + '@module-federation/rspack': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/runtime-tools': 0.8.6 '@module-federation/sdk': 0.8.6 btoa: 1.2.1 @@ -7312,6 +7320,8 @@ snapshots: - supports-color - utf-8-validate + '@module-federation/error-codes@0.8.4': {} + '@module-federation/error-codes@0.8.6': {} '@module-federation/managers@0.8.6': @@ -7335,14 +7345,14 @@ snapshots: - utf-8-validate - vue-tsc - '@module-federation/rsbuild-plugin@0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13)': + '@module-federation/rsbuild-plugin@0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13)': dependencies: '@module-federation/sdk': 0.8.6 optionalDependencies: - '@module-federation/enhanced': 0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + '@module-federation/enhanced': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@rsbuild/core': 1.1.13 - '@module-federation/rspack@0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))': + '@module-federation/rspack@0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.8.6 '@module-federation/dts-plugin': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) @@ -7350,7 +7360,6 @@ snapshots: '@module-federation/manifest': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/runtime-tools': 0.8.6 '@module-federation/sdk': 0.8.6 - '@rspack/core': 1.1.8(@swc/helpers@0.5.15) optionalDependencies: typescript: 5.7.2 vue-tsc: 2.2.0(typescript@5.7.2) @@ -7360,34 +7369,37 @@ snapshots: - supports-color - utf-8-validate - '@module-federation/runtime-tools@0.5.1': + '@module-federation/runtime-tools@0.8.4': dependencies: - '@module-federation/runtime': 0.5.1 - '@module-federation/webpack-bundler-runtime': 0.5.1 + '@module-federation/runtime': 0.8.4 + '@module-federation/webpack-bundler-runtime': 0.8.4 '@module-federation/runtime-tools@0.8.6': dependencies: '@module-federation/runtime': 0.8.6 '@module-federation/webpack-bundler-runtime': 0.8.6 - '@module-federation/runtime@0.5.1': + '@module-federation/runtime@0.8.4': dependencies: - '@module-federation/sdk': 0.5.1 + '@module-federation/error-codes': 0.8.4 + '@module-federation/sdk': 0.8.4 '@module-federation/runtime@0.8.6': dependencies: '@module-federation/error-codes': 0.8.6 '@module-federation/sdk': 0.8.6 - '@module-federation/sdk@0.5.1': {} + '@module-federation/sdk@0.8.4': + dependencies: + isomorphic-rslog: 0.0.6 '@module-federation/sdk@0.8.6': dependencies: isomorphic-rslog: 0.0.7 - '@module-federation/storybook-addon@3.0.17(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1)': + '@module-federation/storybook-addon@3.0.17(@rsbuild/core@1.1.13)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1)': dependencies: - '@module-federation/enhanced': 0.8.6(@rspack/core@1.1.8(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + '@module-federation/enhanced': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@module-federation/sdk': 0.8.6 optionalDependencies: '@rsbuild/core': 1.1.13 @@ -7410,10 +7422,10 @@ snapshots: fs-extra: 9.1.0 resolve: 1.22.8 - '@module-federation/webpack-bundler-runtime@0.5.1': + '@module-federation/webpack-bundler-runtime@0.8.4': dependencies: - '@module-federation/runtime': 0.5.1 - '@module-federation/sdk': 0.5.1 + '@module-federation/runtime': 0.8.4 + '@module-federation/sdk': 0.8.4 '@module-federation/webpack-bundler-runtime@0.8.6': dependencies: @@ -7545,7 +7557,7 @@ snapshots: '@rsbuild/core@1.1.13': dependencies: - '@rspack/core': 1.1.8(@swc/helpers@0.5.15) + '@rspack/core': '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751(@swc/helpers@0.5.15)' '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.15 core-js: 3.39.0 @@ -7636,12 +7648,12 @@ snapshots: - supports-color - typescript - '@rsbuild/plugin-type-check@1.1.0(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2)': + '@rsbuild/plugin-type-check@1.1.0(@rsbuild/core@1.1.13)(typescript@5.7.2)': dependencies: deepmerge: 4.3.1 json5: 2.2.3 reduce-configs: 1.1.0 - ts-checker-rspack-plugin: 1.0.3(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2) + ts-checker-rspack-plugin: 1.0.3(typescript@5.7.2) optionalDependencies: '@rsbuild/core': 1.1.13 transitivePeerDependencies: @@ -7670,49 +7682,49 @@ snapshots: '@microsoft/api-extractor': 7.48.1(@types/node@22.8.1) typescript: 5.7.2 - '@rspack/binding-darwin-arm64@1.1.8': + '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-darwin-x64@1.1.8': + '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-linux-arm64-gnu@1.1.8': + '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-linux-arm64-musl@1.1.8': + '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-linux-x64-gnu@1.1.8': + '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-linux-x64-musl@1.1.8': + '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-win32-arm64-msvc@1.1.8': + '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-win32-ia32-msvc@1.1.8': + '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding-win32-x64-msvc@1.1.8': + '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751': optional: true - '@rspack/binding@1.1.8': + '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751': optionalDependencies: - '@rspack/binding-darwin-arm64': 1.1.8 - '@rspack/binding-darwin-x64': 1.1.8 - '@rspack/binding-linux-arm64-gnu': 1.1.8 - '@rspack/binding-linux-arm64-musl': 1.1.8 - '@rspack/binding-linux-x64-gnu': 1.1.8 - '@rspack/binding-linux-x64-musl': 1.1.8 - '@rspack/binding-win32-arm64-msvc': 1.1.8 - '@rspack/binding-win32-ia32-msvc': 1.1.8 - '@rspack/binding-win32-x64-msvc': 1.1.8 - - '@rspack/core@1.1.8(@swc/helpers@0.5.15)': - dependencies: - '@module-federation/runtime-tools': 0.5.1 - '@rspack/binding': 1.1.8 + '@rspack/binding-darwin-arm64': '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-darwin-x64': '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-linux-arm64-gnu': '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-linux-arm64-musl': '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-linux-x64-gnu': '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-linux-x64-musl': '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-win32-arm64-msvc': '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-win32-ia32-msvc': '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding-win32-x64-msvc': '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751' + + '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751(@swc/helpers@0.5.15)': + dependencies: + '@module-federation/runtime-tools': 0.8.4 + '@rspack/binding': '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751' '@rspack/lite-tapable': 1.0.1 caniuse-lite: 1.0.30001680 optionalDependencies: @@ -10212,6 +10224,8 @@ snapshots: isobject@3.0.1: {} + isomorphic-rslog@0.0.6: {} + isomorphic-rslog@0.0.7: {} isomorphic-ws@5.0.0(ws@8.18.0): @@ -12110,18 +12124,18 @@ snapshots: stdin-discarder@0.2.2: {} - storybook-addon-rslib@0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2): + storybook-addon-rslib@0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2): dependencies: '@rsbuild/core': 1.1.13 '@rslib/core': link:packages/core - storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) + storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) optionalDependencies: typescript: 5.7.2 - storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3): + storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3): dependencies: '@rsbuild/core': 1.1.13 - '@rsbuild/plugin-type-check': 1.1.0(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2) + '@rsbuild/plugin-type-check': 1.1.0(@rsbuild/core@1.1.13)(typescript@5.7.2) '@storybook/addon-docs': 8.4.2(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(webpack-sources@3.2.3) '@storybook/core-webpack': 8.4.2(storybook@8.4.7(prettier@3.4.2)) browser-assert: 1.2.1 @@ -12147,7 +12161,7 @@ snapshots: - '@types/react' - webpack-sources - storybook-react-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1): + storybook-react-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1): dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.18.1) '@rsbuild/core': 1.1.13 @@ -12161,7 +12175,7 @@ snapshots: react-dom: 19.0.0(react@19.0.0) resolve: 1.22.8 storybook: 8.4.7(prettier@3.4.2) - storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.1.8(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) + storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) tsconfig-paths: 4.2.0 optionalDependencies: typescript: 5.7.2 @@ -12428,7 +12442,7 @@ snapshots: trough@2.2.0: {} - ts-checker-rspack-plugin@1.0.3(@rspack/core@1.1.8(@swc/helpers@0.5.15))(typescript@5.7.2): + ts-checker-rspack-plugin@1.0.3(typescript@5.7.2): dependencies: '@babel/code-frame': 7.26.2 '@rspack/lite-tapable': 1.0.1 @@ -12437,8 +12451,6 @@ snapshots: minimatch: 9.0.5 picocolors: 1.1.1 typescript: 5.7.2 - optionalDependencies: - '@rspack/core': 1.1.8(@swc/helpers@0.5.15) ts-dedent@2.2.0: {} diff --git a/tests/integration/alias/__snapshots__/index.test.ts.snap b/tests/integration/alias/__snapshots__/index.test.ts.snap index ee0ddabf5..3ff127d40 100644 --- a/tests/integration/alias/__snapshots__/index.test.ts.snap +++ b/tests/integration/alias/__snapshots__/index.test.ts.snap @@ -20,8 +20,8 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe `; exports[`source.alias 3`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE__a_js__ from "./a.js"; -console.info(__WEBPACK_EXTERNAL_MODULE__a_js__.a); +"import * as __WEBPACK_EXTERNAL_MODULE__a_js_256e6de1__ from "./a.js"; +console.info(__WEBPACK_EXTERNAL_MODULE__a_js_256e6de1__.a); " `; diff --git a/tests/integration/alias/index.test.ts b/tests/integration/alias/index.test.ts index 331423b9b..49de522c8 100644 --- a/tests/integration/alias/index.test.ts +++ b/tests/integration/alias/index.test.ts @@ -28,7 +28,7 @@ test('source.alias', async () => { // bundleless mode expect(indexBundlelessEsmContent).toContain( - 'import * as __WEBPACK_EXTERNAL_MODULE__a_js__ from "./a.js";', + 'import * as __WEBPACK_EXTERNAL_MODULE__a_js_256e6de1__ from "./a.js";', ); expect(indexBundlelessCjsContent).toContain( 'const external_a_cjs_namespaceObject = require("./a.cjs");', diff --git a/tests/integration/asset/__snapshots__/index.test.ts.snap b/tests/integration/asset/__snapshots__/index.test.ts.snap index 760555217..50129058c 100644 --- a/tests/integration/asset/__snapshots__/index.test.ts.snap +++ b/tests/integration/asset/__snapshots__/index.test.ts.snap @@ -1,24 +1,24 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`use svgr 1`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; +"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; import "react"; -const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", { +const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", ...props, - children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("g", { + children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", { fill: "#61DAFB", children: [ - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4" }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("circle", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", { cx: 420.9, cy: 296.5, r: 45.7 }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M520.5 78.1" }) ] @@ -30,24 +30,24 @@ console.log(logoreact); `; exports[`use svgr 2`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; +"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; import "react"; -const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", { +const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", ...props, - children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("g", { + children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", { fill: "#61DAFB", children: [ - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4" }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("circle", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", { cx: 420.9, cy: 296.5, r: 45.7 }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M520.5 78.1" }) ] @@ -59,24 +59,24 @@ console.log(logoreact); `; exports[`use svgr 3`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; +"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; import "react"; -const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", { +const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", ...props, - children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("g", { + children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", { fill: "#61DAFB", children: [ - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4" }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("circle", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", { cx: 420.9, cy: 296.5, r: 45.7 }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M520.5 78.1" }) ] @@ -87,24 +87,24 @@ console.log(SvgLogo); `; exports[`use svgr 4`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; +"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; import "react"; -const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", { +const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", ...props, - children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("g", { + children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", { fill: "#61DAFB", children: [ - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4" }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("circle", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", { cx: 420.9, cy: 296.5, r: 45.7 }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M520.5 78.1" }) ] diff --git a/tests/integration/auto-external/index.test.ts b/tests/integration/auto-external/index.test.ts index 693e05b3c..02dc74da7 100644 --- a/tests/integration/auto-external/index.test.ts +++ b/tests/integration/auto-external/index.test.ts @@ -29,7 +29,7 @@ test('auto external sub path should works', async () => { 'import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react"', ); expect(entries.esm).toContain( - 'import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"', + 'import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"', ); expect(entries.cjs).toContain( diff --git a/tests/integration/bundle-false/__snapshots__/index.test.ts.snap b/tests/integration/bundle-false/__snapshots__/index.test.ts.snap index bf32b380f..b9b52178a 100644 --- a/tests/integration/bundle-false/__snapshots__/index.test.ts.snap +++ b/tests/integration/bundle-false/__snapshots__/index.test.ts.snap @@ -1,24 +1,24 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`svgr in bundleless 1`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; +"import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; import "react"; -const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", { +const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", ...props, - children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("g", { + children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", { fill: "#61DAFB", children: [ - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4" }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("circle", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", { cx: 420.9, cy: 296.5, r: 45.7 }), - /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", { + /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", { d: "M520.5 78.1" }) ] diff --git a/tests/integration/bundle-false/index.test.ts b/tests/integration/bundle-false/index.test.ts index c216309ce..c3c9b0d9c 100644 --- a/tests/integration/bundle-false/index.test.ts +++ b/tests/integration/bundle-false/index.test.ts @@ -89,10 +89,10 @@ test('auto add js extension for relative import', async () => { // basic esm for (const importer of [ - 'import * as __WEBPACK_EXTERNAL_MODULE__bar_js__ from "./bar.js";', - 'import * as __WEBPACK_EXTERNAL_MODULE__baz_js_js__ from "./baz.js.js";', - 'import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js";', - 'import * as __WEBPACK_EXTERNAL_MODULE__qux_js__ from "./qux.js";', + 'import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js";', + 'import * as __WEBPACK_EXTERNAL_MODULE__baz_js_js_7d4e15b7__ from "./baz.js.js";', + 'import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js";', + 'import * as __WEBPACK_EXTERNAL_MODULE__qux_js_3d9e4fc9__ from "./qux.js";', ]) { expect(Object.values(contents.esm0!)[3]).toContain(importer); } @@ -109,10 +109,10 @@ test('auto add js extension for relative import', async () => { // using `autoExtension: false` along with `output.filename.js` - esm for (const importer of [ - 'import * as __WEBPACK_EXTERNAL_MODULE__bar_mjs__ from "./bar.mjs";', - 'import * as __WEBPACK_EXTERNAL_MODULE__baz_js_mjs__ from "./baz.js.mjs";', - 'import * as __WEBPACK_EXTERNAL_MODULE__foo_mjs__ from "./foo.mjs";', - 'import * as __WEBPACK_EXTERNAL_MODULE__qux_mjs__ from "./qux.mjs";', + 'import * as __WEBPACK_EXTERNAL_MODULE__bar_mjs_89c909f2__ from "./bar.mjs";', + 'import * as __WEBPACK_EXTERNAL_MODULE__baz_js_mjs_09565ba6__ from "./baz.js.mjs";', + 'import * as __WEBPACK_EXTERNAL_MODULE__foo_mjs_ccdcdd01__ from "./foo.mjs";', + 'import * as __WEBPACK_EXTERNAL_MODULE__qux_mjs_83952e37__ from "./qux.mjs";', ]) { expect(Object.values(contents.esm1!)[3]).toContain(importer); } diff --git a/tests/integration/external-helpers/__snapshots__/index.test.ts.snap b/tests/integration/external-helpers/__snapshots__/index.test.ts.snap index 571cc3e4c..0ddb86c55 100644 --- a/tests/integration/external-helpers/__snapshots__/index.test.ts.snap +++ b/tests/integration/external-helpers/__snapshots__/index.test.ts.snap @@ -1,14 +1,14 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`should external @swc/helpers when externalHelpers is true 1`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__ from "@swc/helpers/_/_class_call_check"; -import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__ from "@swc/helpers/_/_create_class"; +"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__ from "@swc/helpers/_/_class_call_check"; +import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__ from "@swc/helpers/_/_create_class"; var src_rslib_entry_FOO = /*#__PURE__*/ function() { "use strict"; function FOO() { - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__._)(this, FOO); + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__._)(this, FOO); } - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__._)(FOO, [ + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__._)(FOO, [ { key: "bar", get: function() {} @@ -21,14 +21,14 @@ export { src_rslib_entry_FOO as default }; `; exports[`should external @swc/helpers when externalHelpers is true 2`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__ from "@swc/helpers/_/_class_call_check"; -import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__ from "@swc/helpers/_/_create_class"; +"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__ from "@swc/helpers/_/_class_call_check"; +import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__ from "@swc/helpers/_/_create_class"; var src_rslib_entry_FOO = /*#__PURE__*/ function() { "use strict"; function FOO() { - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__._)(this, FOO); + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__._)(this, FOO); } - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__._)(FOO, [ + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__._)(FOO, [ { key: "bar", get: function() {} @@ -111,14 +111,14 @@ export { src_rslib_entry_FOO as default }; `; exports[`should respect user override externalHelpers config 2`] = ` -"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__ from "@swc/helpers/_/_class_call_check"; -import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__ from "@swc/helpers/_/_create_class"; +"import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__ from "@swc/helpers/_/_class_call_check"; +import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__ from "@swc/helpers/_/_create_class"; var src_rslib_entry_FOO = /*#__PURE__*/ function() { "use strict"; function FOO() { - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__._)(this, FOO); + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check_f500f6c3__._)(this, FOO); } - (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__._)(FOO, [ + (0, __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class_63e94838__._)(FOO, [ { key: "bar", get: function() {} diff --git a/tests/integration/externals/index.test.ts b/tests/integration/externals/index.test.ts index 129942075..ca93be81c 100644 --- a/tests/integration/externals/index.test.ts +++ b/tests/integration/externals/index.test.ts @@ -16,7 +16,7 @@ test('auto externalize Node.js built-in modules when `output.target` is "node"', for (const external of [ 'import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs"', - 'import * as __WEBPACK_EXTERNAL_MODULE_node_assert__ from "node:assert"', + 'import * as __WEBPACK_EXTERNAL_MODULE_node_assert_3e74d44e__ from "node:assert"', 'import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react"', 'import * as __WEBPACK_EXTERNAL_MODULE_bar__ from "bar"', 'module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("foo");', diff --git a/tests/integration/format/index.test.ts b/tests/integration/format/index.test.ts index 9e32f5529..76d07b2b4 100644 --- a/tests/integration/format/index.test.ts +++ b/tests/integration/format/index.test.ts @@ -14,8 +14,8 @@ test('esm', async () => { } `); expect(entries.esm).toMatchInlineSnapshot(` - "import * as __WEBPACK_EXTERNAL_MODULE_node_url__ from "node:url"; - const packageDirectory = __WEBPACK_EXTERNAL_MODULE_node_url__["default"].fileURLToPath(new URL('.', import.meta.url)); + "import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url"; + const packageDirectory = __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__["default"].fileURLToPath(new URL('.', import.meta.url)); const foo = 'foo'; export { foo, packageDirectory }; " diff --git a/tests/integration/minify/index.test.ts b/tests/integration/minify/index.test.ts index 320b58821..c42de002a 100644 --- a/tests/integration/minify/index.test.ts +++ b/tests/integration/minify/index.test.ts @@ -7,36 +7,36 @@ describe('minify config', () => { const fixturePath = join(__dirname, 'default'); const { entries } = await buildAndGetResults({ fixturePath }); expect(entries.esm).toMatchInlineSnapshot(` - "/*! For license information please see index.js.LICENSE.txt */ - import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; - /*! Legal Comment */ const foo = ()=>{}; - const Button = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)('button', {}); - export { Button, foo }; - " - `); + "/*! For license information please see index.js.LICENSE.txt */ + import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; + /*! Legal Comment */ const foo = ()=>{}; + const Button = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)('button', {}); + export { Button, foo }; + " + `); }); test('minify is disabled, nothing will be stripped', async () => { const fixturePath = join(__dirname, 'config/disabled'); const { entries } = await buildAndGetResults({ fixturePath }); expect(entries.esm).toMatchInlineSnapshot(` - "import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime"; + "import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime"; - ;// CONCATENATED MODULE: external "react/jsx-runtime" + ;// CONCATENATED MODULE: external "react/jsx-runtime" - ;// CONCATENATED MODULE: ../../__fixtures__/src/index.ts?__rslib_entry__ - /*! Legal Comment */ - const foo = ()=>{}; - const bar = ()=>{}; - const baz = ()=>{ - return bar(); - }; - // normal comment - const Button = ()=>/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)('button', {}); + ;// CONCATENATED MODULE: ../../__fixtures__/src/index.ts?__rslib_entry__ + /*! Legal Comment */ + const foo = ()=>{}; + const bar = ()=>{}; + const baz = ()=>{ + return bar(); + }; + // normal comment + const Button = ()=>/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)('button', {}); - export { Button, foo }; - " - `); + export { Button, foo }; + " + `); }); test('minify is enabled, only preserve some comments and annotations', async () => { diff --git a/tests/integration/redirect/js.test.ts b/tests/integration/redirect/js.test.ts index 18cc4cdcb..c7a233c7e 100644 --- a/tests/integration/redirect/js.test.ts +++ b/tests/integration/redirect/js.test.ts @@ -21,12 +21,10 @@ test('redirect.js default', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js__ from "./bar/index.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; - import * as __WEBPACK_EXTERNAL_MODULE__baz_js__ from "./baz.js"; - console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js__.baz); + import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " `); @@ -46,14 +44,12 @@ test('redirect.js.path false', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar__ from "@/bar"; - import * as __WEBPACK_EXTERNAL_MODULE__foo__ from "@/foo"; - import * as __WEBPACK_EXTERNAL_MODULE__baz__ from "~/baz"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_js__ from "./bar.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; - console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js__.bar + __WEBPACK_EXTERNAL_MODULE__foo__.foo + __WEBPACK_EXTERNAL_MODULE__bar__.bar + __WEBPACK_EXTERNAL_MODULE__baz__.baz); + import * as __WEBPACK_EXTERNAL_MODULE__bar_js_fb2b582c__ from "@/bar.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_ce8863d2__ from "@/foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_js_b1797427__ from "~/baz.js"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__.bar + __WEBPACK_EXTERNAL_MODULE__foo_js_ce8863d2__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js_fb2b582c__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_b1797427__.baz); export { src_rslib_entry_ as default }; " `); @@ -71,14 +67,12 @@ test('redirect.js.path with user override externals', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js__ from "./others/bar/index.js"; - import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js__ from "./others/foo.js"; - import * as __WEBPACK_EXTERNAL_MODULE__baz_js__ from "./baz.js"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js__ from "./bar/index.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; - console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js__.baz); + import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__ from "./others/bar/index.js"; + import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__ from "./others/foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " `); @@ -104,14 +98,12 @@ test('redirect.js.path with user override alias', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js__ from "./others/bar/index.js"; - import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js__ from "./others/foo.js"; - import * as __WEBPACK_EXTERNAL_MODULE__baz_js__ from "./baz.js"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js__ from "./bar/index.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; - console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js__.baz); + import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__ from "./others/bar/index.js"; + import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__ from "./others/foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " `); @@ -132,12 +124,10 @@ test('redirect.js.extension: false', async () => { ); expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_index_ts__ from "./bar/index.ts"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_ts__ from "./foo.ts"; - import * as __WEBPACK_EXTERNAL_MODULE__baz_ts__ from "./baz.ts"; - console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_ts__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts__.bar + __WEBPACK_EXTERNAL_MODULE__foo_ts__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts__.bar + __WEBPACK_EXTERNAL_MODULE__baz_ts__.baz); + import * as __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__ from "./bar/index.ts"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__ from "./foo.ts"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_ts_10ee073f__ from "./baz.ts"; + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__.bar + __WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__.bar + __WEBPACK_EXTERNAL_MODULE__baz_ts_10ee073f__.baz); export { src_rslib_entry_ as default }; " `); diff --git a/tests/integration/require/index.test.ts b/tests/integration/require/index.test.ts index c7c580142..a74030375 100644 --- a/tests/integration/require/index.test.ts +++ b/tests/integration/require/index.test.ts @@ -18,8 +18,8 @@ test('require.resolve', async () => { ]; const esmStatements = [ - 'import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module"', - 'const _require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url)', + 'import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module"', + 'const _require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url)', ]; const cjsStatements = [ @@ -47,8 +47,8 @@ test('require dynamic', async () => { ]; const esmStatements = [ - 'import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module"', - 'const _require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url)', + 'import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module"', + 'const _require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url)', ]; const cjsStatements = [ diff --git a/tests/integration/resolve/index.test.ts b/tests/integration/resolve/index.test.ts index 56912d885..7a47576db 100644 --- a/tests/integration/resolve/index.test.ts +++ b/tests/integration/resolve/index.test.ts @@ -30,8 +30,8 @@ test('resolve node protocol', async () => { expect(isSuccess).toBeTruthy(); expect(entries.esm).toMatchInlineSnapshot(` - "import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path"; - const { join } = __WEBPACK_EXTERNAL_MODULE_node_path__["default"]; + "import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path"; + const { join } = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"]; export { join }; " `); diff --git a/tests/integration/shims/index.test.ts b/tests/integration/shims/index.test.ts index 67a62d627..e6843ea5a 100644 --- a/tests/integration/shims/index.test.ts +++ b/tests/integration/shims/index.test.ts @@ -106,10 +106,10 @@ describe('CJS shims', () => { const fixturePath = join(__dirname, 'cjs'); const { entries } = await buildAndGetResults({ fixturePath }); expect(entries.esm).toMatchInlineSnapshot(` - "import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module"; + "import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module"; import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url"; const importMetaUrl = import.meta.url; - const src_rslib_entry_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url); + const src_rslib_entry_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url); const requiredModule = src_rslib_entry_require('./ok.cjs'); const src_rslib_entry_filename = (0, __WEBPACK_EXTERNAL_MODULE_url__.fileURLToPath)(import.meta.url); console.log(src_rslib_entry_filename); diff --git a/tests/integration/transform-import/index.test.ts b/tests/integration/transform-import/index.test.ts index 349c41a29..790b70b1e 100644 --- a/tests/integration/transform-import/index.test.ts +++ b/tests/integration/transform-import/index.test.ts @@ -10,7 +10,7 @@ test('transformImport with arco-design', async () => { for (const format of formats) { expect(Object.values(contents[format]!)[0]).toContain( format.startsWith('esm') - ? 'import * as __WEBPACK_EXTERNAL_MODULE__arco_design_web_react_es_button__ from "@arco-design/web-react/es/button"' + ? 'import * as __WEBPACK_EXTERNAL_MODULE__arco_design_web_react_es_button_8d812d96__ from "@arco-design/web-react/es/button"' : 'const button_namespaceObject = require("@arco-design/web-react/es/button")', ); expect(Object.values(contents[format]!)[0]).toContain( @@ -29,12 +29,12 @@ test('transformImport with lodash', async () => { for (const format of formats) { expect(Object.values(contents[format]!)[0]).toContain( format.startsWith('esm') - ? 'import * as __WEBPACK_EXTERNAL_MODULE_lodash_get__ from "lodash/get"' + ? 'import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_5fc72f99__ from "lodash/get"' : 'const get_namespaceObject = require("lodash/get")', ); expect(Object.values(contents[format]!)[0]).toContain( format.startsWith('esm') - ? 'import * as __WEBPACK_EXTERNAL_MODULE_lodash_fp_add__ from "lodash/fp/add"' + ? 'import * as __WEBPACK_EXTERNAL_MODULE_lodash_fp_add_73c13873__ from "lodash/fp/add"' : 'const add_namespaceObject = require("lodash/fp/add")', ); } From ffa48477fda2be4f6b333b1a1844cb1a0750e5bd Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Mon, 30 Dec 2024 16:37:44 +0800 Subject: [PATCH 2/6] test: enable persistent cache --- package.json | 2 +- packages/core/src/config.ts | 3 + .../tests/__snapshots__/config.test.ts.snap | 12 ++ pnpm-lock.yaml | 149 +++++++++--------- tests/integration/redirect/js.test.ts | 18 ++- .../redirect/jsNotResolved.test.ts | 18 +-- website/rspress.config.ts | 9 ++ 7 files changed, 124 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index 61cd3a11b..c08c77d99 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "pnpm": { "overrides": { - "@rspack/core": "npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751", + "@rspack/core": "1.2.0-alpha.0", "zx>@types/node": "-" } } diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index ada1ac244..a1c399be5 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -473,6 +473,9 @@ export async function createConstantRsbuildConfig(): Promise nodeEnv: false, }, experiments: { + cache: { + type: 'persistent', + }, rspackFuture: { bundlerInfo: { force: false, diff --git a/packages/core/tests/__snapshots__/config.test.ts.snap b/packages/core/tests/__snapshots__/config.test.ts.snap index 65289ae66..45720b16b 100644 --- a/packages/core/tests/__snapshots__/config.test.ts.snap +++ b/packages/core/tests/__snapshots__/config.test.ts.snap @@ -133,6 +133,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "rspack": [ { "experiments": { + "cache": { + "type": "persistent", + }, "rspackFuture": { "bundlerInfo": { "force": false, @@ -378,6 +381,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "rspack": [ { "experiments": { + "cache": { + "type": "persistent", + }, "rspackFuture": { "bundlerInfo": { "force": false, @@ -602,6 +608,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "rspack": [ { "experiments": { + "cache": { + "type": "persistent", + }, "rspackFuture": { "bundlerInfo": { "force": false, @@ -773,6 +782,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "rspack": [ { "experiments": { + "cache": { + "type": "persistent", + }, "rspackFuture": { "bundlerInfo": { "force": false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 97aea1c12..7bccc8817 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 + '@rspack/core': 1.2.0-alpha.0 zx>@types/node: '-' importers: @@ -89,7 +89,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rsbuild/core': specifier: ~1.1.13 version: 1.1.13 @@ -110,13 +110,13 @@ importers: devDependencies: '@module-federation/enhanced': specifier: ^0.8.6 - version: 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + version: 0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@module-federation/storybook-addon': specifier: ^3.0.17 - version: 3.0.17(@rsbuild/core@1.1.13)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1) + version: 3.0.17(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1) '@rsbuild/plugin-react': specifier: ^1.1.0 version: 1.1.0(@rsbuild/core@1.1.13) @@ -140,10 +140,10 @@ importers: version: 8.4.7(prettier@3.4.2) storybook-addon-rslib: specifier: ^0.1.6 - version: 0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2) + version: 0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2) storybook-react-rsbuild: specifier: ^0.1.6 - version: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1) + version: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1) examples/module-federation/mf-remote: dependencies: @@ -156,7 +156,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rsbuild/core': specifier: ~1.1.13 version: 1.1.13 @@ -274,7 +274,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -396,7 +396,7 @@ importers: version: 4.0.0(vite@5.3.3(@types/node@22.8.1)(terser@5.31.6))(vitest@2.1.8(@types/node@22.8.1)(terser@5.31.6)) '@module-federation/rsbuild-plugin': specifier: ^0.8.6 - version: 0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) + version: 0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13) '@playwright/test': specifier: 1.49.1 version: 1.49.1 @@ -1636,7 +1636,7 @@ packages: '@module-federation/rspack@0.8.6': resolution: {integrity: sha512-DAZ41bthtZ4hqGXreov2VRs+bM6ee5O2mzI1OTjZv0zQZpaTEAEJJ4JU6ei4BWYAN0A7YIuM9HPPUtkQISdvVw==} peerDependencies: - '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 + '@rspack/core': 1.2.0-alpha.0 typescript: ^4.9.0 || ^5.0.0 vue-tsc: '>=1.0.24' peerDependenciesMeta: @@ -1962,56 +1962,56 @@ packages: typescript: optional: true - '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-PyNHii4EFpyp+MkLlTN2RsRS0fqGjDSX3MJ6I6jIh2SSYFKkeu3MwMVs4pCH1YkWQezSgqXoT9a8LXRCEGwWIw==} + '@rspack/binding-darwin-arm64@1.2.0-alpha.0': + resolution: {integrity: sha512-EPprIe6BrkJ9XuWL5HBXJFaH4vvt5C2kBTvyu+t5E3wacyH9A0gIDaMOEmH30Kt3zl4B07OCBC1nCiJ1sTtimw==} cpu: [arm64] os: [darwin] - '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-p7hrgYiLmiLaVAUipVaVRr35KsNmUx4WH/kCna6Y29h+5ySltmNmHTCU3WCrrkwIsEzj/3z5EDio2aKiIS5dCA==} + '@rspack/binding-darwin-x64@1.2.0-alpha.0': + resolution: {integrity: sha512-ACwdgWg0V9j0o3gs1wvhqRJ4xui82L+Fii9Fa74az7P974iWO0ZHw4QIUaO5r434+v9OWMqpyBRN1M7cBrx3GA==} cpu: [x64] os: [darwin] - '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-vlsGKGV99jApjyAR44+4NwIpIngphrHntCiylkqE6XtjlNIR91uTen3YHQ+rUhxJHyJcFkfUc3XeR6NyLiIx7w==} + '@rspack/binding-linux-arm64-gnu@1.2.0-alpha.0': + resolution: {integrity: sha512-Ex9SviDikz9E36R4I5si/626FsYOJ35l1Lb+DCRUijjjsvoq4k8Shi8csyBfubR+JZ1M0uOXjJftu1Gm5z8Q0Q==} cpu: [arm64] os: [linux] - '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-U6IZ0U/iNjh1LA1Cw4mwIoKlC0AX5NzLRKEpsMs2lPLOnVnZAxhl3uwnyuXjr/vAYqhfeH4H0H2PlnVx8YQNWQ==} + '@rspack/binding-linux-arm64-musl@1.2.0-alpha.0': + resolution: {integrity: sha512-U320xZmTcTwQ0BR8yIzE1L4olMCqzYkT3VFjXPR6iok/Mj0xjfk/SiKhLoZml473qQrHSGaFJ321cp02zgTFJg==} cpu: [arm64] os: [linux] - '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-bhSJHsCmmcTk4OL/iGYYSjSktdTxiWcWAt7q9u3bkI+SSjue+0b1IvLMV23InziEKWaI/QuJ+SZEJoll6SjAtw==} + '@rspack/binding-linux-x64-gnu@1.2.0-alpha.0': + resolution: {integrity: sha512-GNur7VXJ29NtJhY8PYgv3Fv1Zxbx0XZhDUj/+7Wp40CAXRFsLgXScZIRh2U30TECYaihboZ7BD+xugv8MQPDoA==} cpu: [x64] os: [linux] - '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-8kBQFMJ3S8FfHXu5E/dDHyRfx+o3ELUDlAPw7RRkgIE8a89fKyHNdMjs6w1fLpF/xjyE/v9i4RRfPQENH74VHg==} + '@rspack/binding-linux-x64-musl@1.2.0-alpha.0': + resolution: {integrity: sha512-0IdswzpG9+sgxvGu7KTwSeqfV0hvciaHMoZvGklfZa2txpcUqAg4ASp7uxrNaUo+G2a1fTUMOtP9351Cnl8DBg==} cpu: [x64] os: [linux] - '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-pj10jbsjQ4vXCz2hVDky6yaKYaJ26Pzhj5yfrbZBxbDPyklcNYTnfXKAUB6QwSgpQ3choKcAzWvhm3fDcjD2/w==} + '@rspack/binding-win32-arm64-msvc@1.2.0-alpha.0': + resolution: {integrity: sha512-FcFgoWGjSrCfJwDZY5bDA2aO02l5BP7qdyW6ehjwBiMxNZyeSbGvKz3jXl5TtTHR1IgdLzi9kEJkTPYLLMiE1A==} cpu: [arm64] os: [win32] - '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-iCx7UzCQ1dnHRPBubqJj5P+NBkRMNLH3NHe1GScPEKkFIIO3CROA6m+f6lrRcrzeIl3XMlS9rfkuvjKUNFLRBw==} + '@rspack/binding-win32-ia32-msvc@1.2.0-alpha.0': + resolution: {integrity: sha512-cZYFJw6DKCaPPz9VDJPndZ9KSp+/eedgt11Mv8OTpq+MJTUjB2HjtcjqJh8xxVcp3IuwvSMndTkC69WWt/4feA==} cpu: [ia32] os: [win32] - '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-XijlB3KlSq/avhknTDrHlTDDr4eLuGSa7hxPDVaQIcuhWCCAHEmfniknk6a1DL6DzLwvBqIH8Yz8vqQu/urd8Q==} + '@rspack/binding-win32-x64-msvc@1.2.0-alpha.0': + resolution: {integrity: sha512-gfOqb/rq5716NV+Vbk5MteBhV4VhJeSoh2+dRQjdy4EN1wPZ+Uebs9ORVrT9uRjY3JrPn/5PkAHJXtgaOA9Uyg==} cpu: [x64] os: [win32] - '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-wQc5r9FrbdliLLKZGNJ24FRumVtuUJfnMa0Os90B1gqPA1oBwF+CSTSOZ+AWDCfpiXjbSxchLyIgYpdaStZdXg==} + '@rspack/binding@1.2.0-alpha.0': + resolution: {integrity: sha512-rtmDScjtGUxv1zA1m3jXecuX2LsgNp4aWaAjOowHasoO1YqfHK0fMyprCiPowTjoHtpZ7Xt/tnMhii0GlGIITQ==} - '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751': - resolution: {integrity: sha512-IjW+6VVUFbranhLkbLBrFGQYsoPCYW+JgOFmYADdq+qzLjhm7W+4NNsP4l47EG3K9EsWWppA/H8iYMnKQNjjXg==} + '@rspack/core@1.2.0-alpha.0': + resolution: {integrity: sha512-YiD0vFDj+PfHs3ZqJwPNhTYyVTb4xR6FpOI5WJ4jJHV4lgdErS+RChTCPhf1xeqxfuTSSnFA7UeqosLhBuNSqQ==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -6067,7 +6067,7 @@ packages: resolution: {integrity: sha512-K5BUrytoFju1Olu11T49vlYvDEGOguBF1CBCl4o2ARxDGPoJHHf7fBzLlK0YYkUqI5EFA5cMRUC6332M7hQBHw==} engines: {node: '>=16.0.0'} peerDependencies: - '@rspack/core': npm:@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751 + '@rspack/core': 1.2.0-alpha.0 typescript: '>=3.8.0' peerDependenciesMeta: '@rspack/core': @@ -7295,14 +7295,14 @@ snapshots: - supports-color - utf-8-validate - '@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1)': + '@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1)': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.8.6 '@module-federation/data-prefetch': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@module-federation/dts-plugin': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/managers': 0.8.6 '@module-federation/manifest': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) - '@module-federation/rspack': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) + '@module-federation/rspack': 0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/runtime-tools': 0.8.6 '@module-federation/sdk': 0.8.6 btoa: 1.2.1 @@ -7345,14 +7345,14 @@ snapshots: - utf-8-validate - vue-tsc - '@module-federation/rsbuild-plugin@0.8.6(@module-federation/enhanced@0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13)': + '@module-federation/rsbuild-plugin@0.8.6(@module-federation/enhanced@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1))(@rsbuild/core@1.1.13)': dependencies: '@module-federation/sdk': 0.8.6 optionalDependencies: - '@module-federation/enhanced': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + '@module-federation/enhanced': 0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@rsbuild/core': 1.1.13 - '@module-federation/rspack@0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))': + '@module-federation/rspack@0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.8.6 '@module-federation/dts-plugin': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) @@ -7360,6 +7360,7 @@ snapshots: '@module-federation/manifest': 0.8.6(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2)) '@module-federation/runtime-tools': 0.8.6 '@module-federation/sdk': 0.8.6 + '@rspack/core': 1.2.0-alpha.0(@swc/helpers@0.5.15) optionalDependencies: typescript: 5.7.2 vue-tsc: 2.2.0(typescript@5.7.2) @@ -7397,9 +7398,9 @@ snapshots: dependencies: isomorphic-rslog: 0.0.7 - '@module-federation/storybook-addon@3.0.17(@rsbuild/core@1.1.13)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1)': + '@module-federation/storybook-addon@3.0.17(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack-virtual-modules@0.6.2)(webpack@5.96.1)': dependencies: - '@module-federation/enhanced': 0.8.6(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) + '@module-federation/enhanced': 0.8.6(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(webpack@5.96.1) '@module-federation/sdk': 0.8.6 optionalDependencies: '@rsbuild/core': 1.1.13 @@ -7557,7 +7558,7 @@ snapshots: '@rsbuild/core@1.1.13': dependencies: - '@rspack/core': '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751(@swc/helpers@0.5.15)' + '@rspack/core': 1.2.0-alpha.0(@swc/helpers@0.5.15) '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.15 core-js: 3.39.0 @@ -7648,12 +7649,12 @@ snapshots: - supports-color - typescript - '@rsbuild/plugin-type-check@1.1.0(@rsbuild/core@1.1.13)(typescript@5.7.2)': + '@rsbuild/plugin-type-check@1.1.0(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2)': dependencies: deepmerge: 4.3.1 json5: 2.2.3 reduce-configs: 1.1.0 - ts-checker-rspack-plugin: 1.0.3(typescript@5.7.2) + ts-checker-rspack-plugin: 1.0.3(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2) optionalDependencies: '@rsbuild/core': 1.1.13 transitivePeerDependencies: @@ -7682,49 +7683,49 @@ snapshots: '@microsoft/api-extractor': 7.48.1(@types/node@22.8.1) typescript: 5.7.2 - '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-darwin-arm64@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-darwin-x64@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-linux-arm64-gnu@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-linux-arm64-musl@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-linux-x64-gnu@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-linux-x64-musl@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-win32-arm64-msvc@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-win32-ia32-msvc@1.2.0-alpha.0': optional: true - '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding-win32-x64-msvc@1.2.0-alpha.0': optional: true - '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751': + '@rspack/binding@1.2.0-alpha.0': optionalDependencies: - '@rspack/binding-darwin-arm64': '@rspack-canary/binding-darwin-arm64@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-darwin-x64': '@rspack-canary/binding-darwin-x64@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-linux-arm64-gnu': '@rspack-canary/binding-linux-arm64-gnu@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-linux-arm64-musl': '@rspack-canary/binding-linux-arm64-musl@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-linux-x64-gnu': '@rspack-canary/binding-linux-x64-gnu@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-linux-x64-musl': '@rspack-canary/binding-linux-x64-musl@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-win32-arm64-msvc': '@rspack-canary/binding-win32-arm64-msvc@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-win32-ia32-msvc': '@rspack-canary/binding-win32-ia32-msvc@1.1.7-canary-10025e2e-20241225045751' - '@rspack/binding-win32-x64-msvc': '@rspack-canary/binding-win32-x64-msvc@1.1.7-canary-10025e2e-20241225045751' - - '@rspack-canary/core@1.1.7-canary-10025e2e-20241225045751(@swc/helpers@0.5.15)': + '@rspack/binding-darwin-arm64': 1.2.0-alpha.0 + '@rspack/binding-darwin-x64': 1.2.0-alpha.0 + '@rspack/binding-linux-arm64-gnu': 1.2.0-alpha.0 + '@rspack/binding-linux-arm64-musl': 1.2.0-alpha.0 + '@rspack/binding-linux-x64-gnu': 1.2.0-alpha.0 + '@rspack/binding-linux-x64-musl': 1.2.0-alpha.0 + '@rspack/binding-win32-arm64-msvc': 1.2.0-alpha.0 + '@rspack/binding-win32-ia32-msvc': 1.2.0-alpha.0 + '@rspack/binding-win32-x64-msvc': 1.2.0-alpha.0 + + '@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15)': dependencies: '@module-federation/runtime-tools': 0.8.4 - '@rspack/binding': '@rspack-canary/binding@1.1.7-canary-10025e2e-20241225045751' + '@rspack/binding': 1.2.0-alpha.0 '@rspack/lite-tapable': 1.0.1 caniuse-lite: 1.0.30001680 optionalDependencies: @@ -12124,18 +12125,18 @@ snapshots: stdin-discarder@0.2.2: {} - storybook-addon-rslib@0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2): + storybook-addon-rslib@0.1.6(@rsbuild/core@1.1.13)(@rslib/core@packages+core)(storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3))(typescript@5.7.2): dependencies: '@rsbuild/core': 1.1.13 '@rslib/core': link:packages/core - storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) + storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) optionalDependencies: typescript: 5.7.2 - storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3): + storybook-builder-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3): dependencies: '@rsbuild/core': 1.1.13 - '@rsbuild/plugin-type-check': 1.1.0(@rsbuild/core@1.1.13)(typescript@5.7.2) + '@rsbuild/plugin-type-check': 1.1.0(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2) '@storybook/addon-docs': 8.4.2(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(webpack-sources@3.2.3) '@storybook/core-webpack': 8.4.2(storybook@8.4.7(prettier@3.4.2)) browser-assert: 1.2.1 @@ -12161,7 +12162,7 @@ snapshots: - '@types/react' - webpack-sources - storybook-react-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1): + storybook-react-rsbuild@0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(rollup@4.18.1)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3)(webpack@5.96.1): dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.18.1) '@rsbuild/core': 1.1.13 @@ -12175,7 +12176,7 @@ snapshots: react-dom: 19.0.0(react@19.0.0) resolve: 1.22.8 storybook: 8.4.7(prettier@3.4.2) - storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) + storybook-builder-rsbuild: 0.1.6(@rsbuild/core@1.1.13)(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(@types/react@19.0.2)(storybook@8.4.7(prettier@3.4.2))(typescript@5.7.2)(webpack-sources@3.2.3) tsconfig-paths: 4.2.0 optionalDependencies: typescript: 5.7.2 @@ -12442,7 +12443,7 @@ snapshots: trough@2.2.0: {} - ts-checker-rspack-plugin@1.0.3(typescript@5.7.2): + ts-checker-rspack-plugin@1.0.3(@rspack/core@1.2.0-alpha.0(@swc/helpers@0.5.15))(typescript@5.7.2): dependencies: '@babel/code-frame': 7.26.2 '@rspack/lite-tapable': 1.0.1 @@ -12451,6 +12452,8 @@ snapshots: minimatch: 9.0.5 picocolors: 1.1.1 typescript: 5.7.2 + optionalDependencies: + '@rspack/core': 1.2.0-alpha.0(@swc/helpers@0.5.15) ts-dedent@2.2.0: {} diff --git a/tests/integration/redirect/js.test.ts b/tests/integration/redirect/js.test.ts index c7a233c7e..115adfe0e 100644 --- a/tests/integration/redirect/js.test.ts +++ b/tests/integration/redirect/js.test.ts @@ -21,9 +21,11 @@ test('redirect.js default', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; + import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; + console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " @@ -44,12 +46,14 @@ test('redirect.js.path false', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_js_fb2b582c__ from "@/bar.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js_ce8863d2__ from "@/foo.js"; - import * as __WEBPACK_EXTERNAL_MODULE__baz_js_b1797427__ from "~/baz.js"; + import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_943a8c75__ from "@/bar"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_a5f33889__ from "@/foo"; + import * as __WEBPACK_EXTERNAL_MODULE__baz_3ce4598c__ from "~/baz"; import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js"; import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__.bar + __WEBPACK_EXTERNAL_MODULE__foo_js_ce8863d2__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js_fb2b582c__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_b1797427__.baz); + console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__.bar + __WEBPACK_EXTERNAL_MODULE__foo_a5f33889__.foo + __WEBPACK_EXTERNAL_MODULE__bar_943a8c75__.bar + __WEBPACK_EXTERNAL_MODULE__baz_3ce4598c__.baz); export { src_rslib_entry_ as default }; " `); @@ -67,11 +71,13 @@ test('redirect.js.path with user override externals', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; + import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__ from "./others/bar/index.js"; import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__ from "./others/foo.js"; import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " @@ -98,11 +104,13 @@ test('redirect.js.path with user override alias', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; + import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; import * as __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__ from "./others/bar/index.js"; import * as __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__ from "./others/foo.js"; import * as __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__ from "./baz.js"; import * as __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__ from "./bar/index.js"; import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; + console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_js_89500c0c__.bar + __WEBPACK_EXTERNAL_MODULE__others_foo_js_920f94ba__.foo + __WEBPACK_EXTERNAL_MODULE__others_bar_index_js_6776b573__.bar + __WEBPACK_EXTERNAL_MODULE__baz_js_a2c1c788__.baz); export { src_rslib_entry_ as default }; " @@ -124,9 +132,11 @@ test('redirect.js.extension: false', async () => { ); expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; + import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; import * as __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__ from "./bar/index.ts"; import * as __WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__ from "./foo.ts"; import * as __WEBPACK_EXTERNAL_MODULE__baz_ts_10ee073f__ from "./baz.ts"; + console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__.bar + __WEBPACK_EXTERNAL_MODULE__foo_ts_a526d0a1__.foo + __WEBPACK_EXTERNAL_MODULE__bar_index_ts_bd8d18e6__.bar + __WEBPACK_EXTERNAL_MODULE__baz_ts_10ee073f__.baz); export { src_rslib_entry_ as default }; " diff --git a/tests/integration/redirect/jsNotResolved.test.ts b/tests/integration/redirect/jsNotResolved.test.ts index aa4232037..b2cc15ce0 100644 --- a/tests/integration/redirect/jsNotResolved.test.ts +++ b/tests/integration/redirect/jsNotResolved.test.ts @@ -15,10 +15,10 @@ test('redirect.js default', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_js__ from "./bar.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js__["default"]); + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__["default"]); export { src_rslib_entry_ as default }; " `); @@ -37,10 +37,10 @@ test('redirect.js.path false', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_js__ from "./bar.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo_js__ from "./foo.js"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__ from "./foo.js"; console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js__["default"]); + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_js_fdf5aa2d__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__["default"]); export { src_rslib_entry_ as default }; " `); @@ -59,10 +59,10 @@ test('redirect.js.extension: false', async () => { expect(indexContent).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash"; import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier"; - import * as __WEBPACK_EXTERNAL_MODULE__bar_js__ from "./bar.js"; - import * as __WEBPACK_EXTERNAL_MODULE__foo__ from "./foo"; + import * as __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__ from "./bar.js"; + import * as __WEBPACK_EXTERNAL_MODULE__foo_23da6eef__ from "./foo"; console.log('prettier: ', __WEBPACK_EXTERNAL_MODULE_prettier__["default"]); - const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js__["default"]); + const src_rslib_entry_ = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].toUpper(__WEBPACK_EXTERNAL_MODULE__foo_23da6eef__["default"] + __WEBPACK_EXTERNAL_MODULE__bar_js_69b41beb__["default"]); export { src_rslib_entry_ as default }; " `); diff --git a/website/rspress.config.ts b/website/rspress.config.ts index f87c33541..48ec07f27 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -81,6 +81,15 @@ export default defineConfig({ dev: { lazyCompilation: true, }, + tools: { + rspack: { + experiments: { + cache: { + type: 'persistent', + }, + }, + }, + }, source: { alias: { '@components': path.join(__dirname, '@components'), From f4fc62c6c82f778a9f431e704635ad47fc10d64b Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Mon, 30 Dec 2024 20:44:46 +0800 Subject: [PATCH 3/6] chore: update --- packages/core/src/config.ts | 1 + website/rspress.config.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index a1c399be5..20f75dbfa 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -472,6 +472,7 @@ export async function createConstantRsbuildConfig(): Promise moduleIds: 'named', nodeEnv: false, }, + cache: true, experiments: { cache: { type: 'persistent', diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 48ec07f27..d72db0766 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -83,6 +83,7 @@ export default defineConfig({ }, tools: { rspack: { + cache: true, experiments: { cache: { type: 'persistent', From 55ef99c0bd27fcedab801461d3255ec5daa9b831 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Mon, 30 Dec 2024 20:52:44 +0800 Subject: [PATCH 4/6] chore: update --- packages/core/tests/__snapshots__/config.test.ts.snap | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/tests/__snapshots__/config.test.ts.snap b/packages/core/tests/__snapshots__/config.test.ts.snap index 45720b16b..2a65fb945 100644 --- a/packages/core/tests/__snapshots__/config.test.ts.snap +++ b/packages/core/tests/__snapshots__/config.test.ts.snap @@ -132,6 +132,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "htmlPlugin": false, "rspack": [ { + "cache": true, "experiments": { "cache": { "type": "persistent", @@ -380,6 +381,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "htmlPlugin": false, "rspack": [ { + "cache": true, "experiments": { "cache": { "type": "persistent", @@ -607,6 +609,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "htmlPlugin": false, "rspack": [ { + "cache": true, "experiments": { "cache": { "type": "persistent", @@ -781,6 +784,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "htmlPlugin": false, "rspack": [ { + "cache": true, "experiments": { "cache": { "type": "persistent", From 2d547beffba11162e18cd4826a333e87ff77f8ee Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 2 Jan 2025 14:12:34 +0800 Subject: [PATCH 5/6] chore: update --- packages/core/src/config.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 20f75dbfa..39ea4c956 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -1479,7 +1479,17 @@ export async function composeRsbuildEnvironments( for (const { format, id, config } of rsbuildConfigWithLibInfo) { const libId = typeof id === 'string' ? id : composeDefaultId(format); - environments[libId] = config; + environments[libId] = mergeRsbuildConfig(config, { + tools: { + rspack: { + experiments: { + cache: { + version: libId, + }, + }, + }, + }, + } as EnvironmentConfig); environmentWithInfos.push({ id: libId, format, config }); } From 1d2347326cc5c1ba99372e224e412101f840e54f Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 2 Jan 2025 15:28:37 +0800 Subject: [PATCH 6/6] chore: update --- packages/core/src/config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 39ea4c956..e480fb24c 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -1484,7 +1484,10 @@ export async function composeRsbuildEnvironments( rspack: { experiments: { cache: { - version: libId, + version: + libId + + config.source?.entry?.index + + config.output?.distPath?.root, }, }, },