From 601d98871ef54015ef933713f97e6f8e09c06701 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 13 Sep 2024 17:53:47 +0800 Subject: [PATCH 1/2] chore: bump rsbuild 1.0.3 --- .changeset/silent-cobras-sing.md | 5 + CONTRIBUTING.md | 2 +- e2e/package.json | 2 +- examples/react-component/package.json | 2 +- packages/core/package.json | 2 +- packages/plugin-dts/package.json | 2 +- pnpm-lock.yaml | 134 +++++++++++++------------- website/package.json | 2 +- 8 files changed, 78 insertions(+), 73 deletions(-) create mode 100644 .changeset/silent-cobras-sing.md diff --git a/.changeset/silent-cobras-sing.md b/.changeset/silent-cobras-sing.md new file mode 100644 index 000000000..f49e25869 --- /dev/null +++ b/.changeset/silent-cobras-sing.md @@ -0,0 +1,5 @@ +--- +'@rslib/core': patch +--- + +release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76a6b9291..e7370eb53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,4 +140,4 @@ The project is still in its early stages and under active development, so it pos | Package | Link | | ------------ | -------------------------------------------------------------------- | -| @rspack/core | [1.0.3](https://github.com/web-infra-dev/rspack/releases/tag/v1.0.3) | +| @rspack/core | [1.0.5](https://github.com/web-infra-dev/rspack/releases/tag/v1.0.5) | diff --git a/e2e/package.json b/e2e/package.json index 0996b02a2..4efd4279f 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@e2e/helper": "workspace:*", "@playwright/test": "1.47.0", - "@rsbuild/core": "1.0.2", + "@rsbuild/core": "1.0.3", "@rslib/core": "workspace:*", "@rslib/tsconfig": "workspace:*", "@types/fs-extra": "^11.0.4", diff --git a/examples/react-component/package.json b/examples/react-component/package.json index 8cbd180d6..42e062669 100644 --- a/examples/react-component/package.json +++ b/examples/react-component/package.json @@ -5,7 +5,7 @@ "build": "rslib build" }, "devDependencies": { - "@rsbuild/plugin-react": "1.0.1", + "@rsbuild/plugin-react": "1.0.2", "@rslib/core": "workspace:*", "@types/react": "^18.3.5", "react": "^18.3.1" diff --git a/packages/core/package.json b/packages/core/package.json index e64a6740a..ef831aa1f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,7 +37,7 @@ "prebundle": "prebundle" }, "dependencies": { - "@rsbuild/core": "1.0.2", + "@rsbuild/core": "1.0.3", "rsbuild-plugin-dts": "workspace:*" }, "devDependencies": { diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index a8cc7c93c..436efe709 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@microsoft/api-extractor": "^7.47.8", - "@rsbuild/core": "1.0.2", + "@rsbuild/core": "1.0.3", "@rslib/tsconfig": "workspace:*", "rslib": "npm:@rslib/core@0.0.5", "typescript": "^5.6.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df7d6858b..c94f01171 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,8 +67,8 @@ importers: specifier: 1.47.0 version: 1.47.0 '@rsbuild/core': - specifier: 1.0.2 - version: 1.0.2 + specifier: 1.0.3 + version: 1.0.3 '@rslib/core': specifier: workspace:* version: link:../packages/core @@ -287,8 +287,8 @@ importers: examples/react-component: devDependencies: '@rsbuild/plugin-react': - specifier: 1.0.1 - version: 1.0.1(@rsbuild/core@1.0.2) + specifier: 1.0.2 + version: 1.0.2(@rsbuild/core@1.0.3) '@rslib/core': specifier: workspace:* version: link:../../packages/core @@ -305,8 +305,8 @@ importers: specifier: ^7 version: 7.47.8(@types/node@18.19.39) '@rsbuild/core': - specifier: 1.0.2 - version: 1.0.2 + specifier: 1.0.3 + version: 1.0.3 rsbuild-plugin-dts: specifier: workspace:* version: link:../plugin-dts @@ -389,8 +389,8 @@ importers: specifier: ^7.47.8 version: 7.47.8(@types/node@18.19.39) '@rsbuild/core': - specifier: 1.0.2 - version: 1.0.2 + specifier: 1.0.3 + version: 1.0.3 '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -406,8 +406,8 @@ importers: website: devDependencies: '@rsbuild/core': - specifier: 1.0.2 - version: 1.0.2 + specifier: 1.0.3 + version: 1.0.3 '@rslib/tsconfig': specifier: workspace:* version: link:../scripts/tsconfig @@ -1003,8 +1003,8 @@ packages: engines: {node: '>=16.7.0'} hasBin: true - '@rsbuild/core@1.0.2': - resolution: {integrity: sha512-kEHmNj4QjDoqvyswEiz8gJCdc2Yo4SXlQD+TnY7ch8pTVs6kLnXRa1KclFLCdgwYnikYvvPsbBERSF8Y2I3KDg==} + '@rsbuild/core@1.0.3': + resolution: {integrity: sha512-d2mrbhyaIruhcU5fCjEog4hzdC1ep/Q2wODdkwOaHO1bddALc4y4A2KBGSjFsFSWukPc+EFtfftVSwPukAvISg==} engines: {node: '>=16.7.0'} hasBin: true @@ -1013,16 +1013,16 @@ packages: peerDependencies: '@rsbuild/core': ^1.0.1-rc.0 - '@rsbuild/plugin-react@1.0.1': - resolution: {integrity: sha512-JdbuM/Ycwky6XPc0YmXXcDzUYZ4JxIORcio1MB+fJNMOrs3PP1hJF5vUm5NfA7YY391fIMxD9W4oB3GQUI5c6A==} - peerDependencies: - '@rsbuild/core': 1.x || ^1.0.1-rc.0 - '@rsbuild/plugin-react@1.0.1-rc.0': resolution: {integrity: sha512-bjKRNdihb3LoWW74Ri2lBQqrTaksIpGx9/mp/RiRpVUGzX+9/SDlXWvrnWdndKPm7UYfY3VBCZNT2zJRi0CCKg==} peerDependencies: '@rsbuild/core': ^1.0.1-rc.0 + '@rsbuild/plugin-react@1.0.2': + resolution: {integrity: sha512-8Sa4AJ43/ift7ZW1iNMA38ZIEDXNINPa8rGI38u7b42yBgMUWBan8yDjFYAC0Gkg3lh8vCWYVQYZp0RyIS7lqA==} + peerDependencies: + '@rsbuild/core': 1.x || ^1.0.1-rc.0 + '@rsbuild/plugin-sass@1.0.1-rc.0': resolution: {integrity: sha512-t6hjBvSHnJ9SiVnBo66o7M9MPMylVhv+KI1OJVbFH14Y6ZarN3y7Q1n0wYT/qc16N0ETaTegB3z8Xou02mgZ4w==} peerDependencies: @@ -1046,8 +1046,8 @@ packages: cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-arm64@1.0.4': - resolution: {integrity: sha512-HR4OVarDhLYAd3GRus26mGjaoEkvFGSdhRHWPXkTqPWT1QIx+cMTDe2dUnEb/CZyvpH0afLBlVHrxqUBNiLT/Q==} + '@rspack/binding-darwin-arm64@1.0.5': + resolution: {integrity: sha512-pEHj4AOluOa7FaR1DMACPUUZKO3qZI4/66xaTqk0BbclvMT7eheQAWtkmjdE9WJgeZ389TrwZeaMzzPdHhK/6Q==} cpu: [arm64] os: [darwin] @@ -1056,8 +1056,8 @@ packages: cpu: [x64] os: [darwin] - '@rspack/binding-darwin-x64@1.0.4': - resolution: {integrity: sha512-3L/vrzrcBpg1h7SqD+9m7CB0UlkDt3aOyJGZc0vwLOQM8IezRsawEoidyN9KyYhpDzBZHzLAUnsva33BcbFJYQ==} + '@rspack/binding-darwin-x64@1.0.5': + resolution: {integrity: sha512-xS5EDD9l3MHL54bnmxsndm61P9l3l7ZNuLSuPl2MbYJzDqPdnXhTdkIjdcDOLH2daFm8gfB634wa5knZhPGLOw==} cpu: [x64] os: [darwin] @@ -1066,8 +1066,8 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-gnu@1.0.4': - resolution: {integrity: sha512-Ggo2tLJKOFNsdcg9H3eYSUy03Wrq0PMVIlm50p/LLAMlfYm3kxBDNv7fP13fxlUe/oqXtFcVOlmMezbMH4oz8w==} + '@rspack/binding-linux-arm64-gnu@1.0.5': + resolution: {integrity: sha512-svPOFlem7s6T33tX8a28uD5Ngc7bdML96ioiH7Fhi0J/at+WAthor4GeUNwkwuzBQI/Nc9XCgiYPcE0pzP7c6w==} cpu: [arm64] os: [linux] @@ -1076,8 +1076,8 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.0.4': - resolution: {integrity: sha512-2FeDh8/THJTH2N4XpFC9oRvdDlkOw6bQ+vS8x1jLUXj+CDwqmUiECjh+78o4qwe1EH2egWDmkq84RQ+KoR37mQ==} + '@rspack/binding-linux-arm64-musl@1.0.5': + resolution: {integrity: sha512-cysqogEUNc0TgzzXcK9bkv12eoCjqhLzOvGXQU1zSEU9Hov7tuzMDl3Z6R3A7NgOCmWu84/wOnTrkSOI28caew==} cpu: [arm64] os: [linux] @@ -1086,8 +1086,8 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.0.4': - resolution: {integrity: sha512-k2YQ579fDfXBw4KJMvZQQPShFUSln7wqtG59ltNLBejgFSxOtlMfLhY5oSuRvFCtsAS4SQUPOmUmfW/0dpCa7A==} + '@rspack/binding-linux-x64-gnu@1.0.5': + resolution: {integrity: sha512-qIEMsWOzTKpVm0Sg553gKkua49Kd/sElLD1rZcXjjxjAsD97uq8AiNncArMfYdDKgkKbtwtW/Fb3uVuafTLnZg==} cpu: [x64] os: [linux] @@ -1096,8 +1096,8 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.0.4': - resolution: {integrity: sha512-1Pmuq3qnE45U7uhCJNtRbDiQVF+U4BXbsA+ISNd3Gp/MUZqpuOOgrND9OWw7d+xKRifzEMtd81DaPMkrcXyRvw==} + '@rspack/binding-linux-x64-musl@1.0.5': + resolution: {integrity: sha512-yulltMSQN3aBt3NMURYTmJcpAJBi4eEJ4i9qF0INE8f0885sJpI0j35/31POkCghG1ZOSZkYALFrheKKP9e8pg==} cpu: [x64] os: [linux] @@ -1106,8 +1106,8 @@ packages: cpu: [arm64] os: [win32] - '@rspack/binding-win32-arm64-msvc@1.0.4': - resolution: {integrity: sha512-3tBP4xTAe8XRAlchMj2nlQXy2GOICA5StFK0kQMRId4V3xfgjlKDb/dMHMEHH4R1to1f9er9R0cRydUNP5AnbQ==} + '@rspack/binding-win32-arm64-msvc@1.0.5': + resolution: {integrity: sha512-5oF/qN6TnUj28UAdaOgSIWKq7HG5QgI4p37zvQBBTXZHhrwN2kE6H+TaofWnSqWJynwmGIxJIx8bGo3lDfFbfA==} cpu: [arm64] os: [win32] @@ -1116,8 +1116,8 @@ packages: cpu: [ia32] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.0.4': - resolution: {integrity: sha512-VCXXhOh9aWg31RfvJL87cvqIeL8h+gG2LPkXCJ8kzvQItLg6vlXABCGHf3NlaVUnDtAHnhsAT1sOHiD8G/kMfg==} + '@rspack/binding-win32-ia32-msvc@1.0.5': + resolution: {integrity: sha512-y16IPjd/z6L7+r6RXLu7J/jlZDUenSnJDqo10HnnxtLjOJ+vna+pljI8sHcwu1ao0c3J3uMvbkF34dTiev7Opg==} cpu: [ia32] os: [win32] @@ -1126,16 +1126,16 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-win32-x64-msvc@1.0.4': - resolution: {integrity: sha512-hlhAZVpL1MmGJUZ730JvOL6zc12BlfIIwRNnn0PkCrNSxNOYknkfKVix8CfPU9r8L2W8MOJfsbtjteCiJmJnQA==} + '@rspack/binding-win32-x64-msvc@1.0.5': + resolution: {integrity: sha512-PSBTbDSgT+ClYvyQTDtWBi/bxXW/xJmVjg9NOWe8KAEl5WNU+pToiCBLLPCGDSa+K7/zr2TDb6QakG/qYItPZw==} cpu: [x64] os: [win32] '@rspack/binding@1.0.0': resolution: {integrity: sha512-eLyqSEM1h/exJYn98k+9MRktP8AYDB13x5oVn8hoxVucuhk0TubFqQSX8h9SQcZp1O3j/Z8eWWwOaNPe3JU40Q==} - '@rspack/binding@1.0.4': - resolution: {integrity: sha512-YbVyVWvYXCAqUqIyBPEwl+M0js4BqVAxqnsRiZG861MXrqNyYbGOMTcc3Pc6D0SW/gkcWugGWzQ5jgMjAIhHzw==} + '@rspack/binding@1.0.5': + resolution: {integrity: sha512-SnVrzRWeKSosJ0/1e5taAeqJ1ISst6NAE1N8YK4ZdUEVWmE26tC2V/yTvZHSsqatc/0Cf+A18IZJx0q6H/DlRw==} '@rspack/core@1.0.0': resolution: {integrity: sha512-F4RA9uOLLvD1oTKa96Gcly+Sro1qaqPNENadFyiPwepa7DrwexQa/ym6CQKbvKMOYGKlVSFDPUmgFAirz35ETg==} @@ -1146,8 +1146,8 @@ packages: '@swc/helpers': optional: true - '@rspack/core@1.0.4': - resolution: {integrity: sha512-/R3JenF5wJSj3DPxiewyIPGzuZV336XpRORjUAOvbHPK6zea8Eeqcx6RopWM6TMikRYdZOHThKV99tyi4QLsMg==} + '@rspack/core@1.0.5': + resolution: {integrity: sha512-UlydS2VupZ6yBx3jCqCHpeEUQNWCrBkTQhPIezK0eCAk13i745byjqXX4tcfN6jR5Kjh/1CIb8r07k9DgGON1w==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -4797,7 +4797,7 @@ snapshots: '@rsbuild/core@1.0.1-rc.4': dependencies: - '@rspack/core': 1.0.4(@swc/helpers@0.5.13) + '@rspack/core': 1.0.5(@swc/helpers@0.5.13) '@rspack/lite-tapable': 1.0.0 '@swc/helpers': 0.5.13 caniuse-lite: 1.0.30001660 @@ -4805,9 +4805,9 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - '@rsbuild/core@1.0.2': + '@rsbuild/core@1.0.3': dependencies: - '@rspack/core': 1.0.4(@swc/helpers@0.5.13) + '@rspack/core': 1.0.5(@swc/helpers@0.5.13) '@rspack/lite-tapable': 1.0.0 '@swc/helpers': 0.5.13 caniuse-lite: 1.0.30001660 @@ -4821,15 +4821,15 @@ snapshots: deepmerge: 4.3.1 reduce-configs: 1.0.0 - '@rsbuild/plugin-react@1.0.1(@rsbuild/core@1.0.2)': + '@rsbuild/plugin-react@1.0.1-rc.0(@rsbuild/core@1.0.1-rc.0)': dependencies: - '@rsbuild/core': 1.0.2 + '@rsbuild/core': 1.0.1-rc.0 '@rspack/plugin-react-refresh': 1.0.0(react-refresh@0.14.2) react-refresh: 0.14.2 - '@rsbuild/plugin-react@1.0.1-rc.0(@rsbuild/core@1.0.1-rc.0)': + '@rsbuild/plugin-react@1.0.2(@rsbuild/core@1.0.3)': dependencies: - '@rsbuild/core': 1.0.1-rc.0 + '@rsbuild/core': 1.0.3 '@rspack/plugin-react-refresh': 1.0.0(react-refresh@0.14.2) react-refresh: 0.14.2 @@ -4853,55 +4853,55 @@ snapshots: '@rspack/binding-darwin-arm64@1.0.0': optional: true - '@rspack/binding-darwin-arm64@1.0.4': + '@rspack/binding-darwin-arm64@1.0.5': optional: true '@rspack/binding-darwin-x64@1.0.0': optional: true - '@rspack/binding-darwin-x64@1.0.4': + '@rspack/binding-darwin-x64@1.0.5': optional: true '@rspack/binding-linux-arm64-gnu@1.0.0': optional: true - '@rspack/binding-linux-arm64-gnu@1.0.4': + '@rspack/binding-linux-arm64-gnu@1.0.5': optional: true '@rspack/binding-linux-arm64-musl@1.0.0': optional: true - '@rspack/binding-linux-arm64-musl@1.0.4': + '@rspack/binding-linux-arm64-musl@1.0.5': optional: true '@rspack/binding-linux-x64-gnu@1.0.0': optional: true - '@rspack/binding-linux-x64-gnu@1.0.4': + '@rspack/binding-linux-x64-gnu@1.0.5': optional: true '@rspack/binding-linux-x64-musl@1.0.0': optional: true - '@rspack/binding-linux-x64-musl@1.0.4': + '@rspack/binding-linux-x64-musl@1.0.5': optional: true '@rspack/binding-win32-arm64-msvc@1.0.0': optional: true - '@rspack/binding-win32-arm64-msvc@1.0.4': + '@rspack/binding-win32-arm64-msvc@1.0.5': optional: true '@rspack/binding-win32-ia32-msvc@1.0.0': optional: true - '@rspack/binding-win32-ia32-msvc@1.0.4': + '@rspack/binding-win32-ia32-msvc@1.0.5': optional: true '@rspack/binding-win32-x64-msvc@1.0.0': optional: true - '@rspack/binding-win32-x64-msvc@1.0.4': + '@rspack/binding-win32-x64-msvc@1.0.5': optional: true '@rspack/binding@1.0.0': @@ -4916,17 +4916,17 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.0.0 '@rspack/binding-win32-x64-msvc': 1.0.0 - '@rspack/binding@1.0.4': + '@rspack/binding@1.0.5': optionalDependencies: - '@rspack/binding-darwin-arm64': 1.0.4 - '@rspack/binding-darwin-x64': 1.0.4 - '@rspack/binding-linux-arm64-gnu': 1.0.4 - '@rspack/binding-linux-arm64-musl': 1.0.4 - '@rspack/binding-linux-x64-gnu': 1.0.4 - '@rspack/binding-linux-x64-musl': 1.0.4 - '@rspack/binding-win32-arm64-msvc': 1.0.4 - '@rspack/binding-win32-ia32-msvc': 1.0.4 - '@rspack/binding-win32-x64-msvc': 1.0.4 + '@rspack/binding-darwin-arm64': 1.0.5 + '@rspack/binding-darwin-x64': 1.0.5 + '@rspack/binding-linux-arm64-gnu': 1.0.5 + '@rspack/binding-linux-arm64-musl': 1.0.5 + '@rspack/binding-linux-x64-gnu': 1.0.5 + '@rspack/binding-linux-x64-musl': 1.0.5 + '@rspack/binding-win32-arm64-msvc': 1.0.5 + '@rspack/binding-win32-ia32-msvc': 1.0.5 + '@rspack/binding-win32-x64-msvc': 1.0.5 '@rspack/core@1.0.0(@swc/helpers@0.5.13)': dependencies: @@ -4937,10 +4937,10 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.13 - '@rspack/core@1.0.4(@swc/helpers@0.5.13)': + '@rspack/core@1.0.5(@swc/helpers@0.5.13)': dependencies: '@module-federation/runtime-tools': 0.5.1 - '@rspack/binding': 1.0.4 + '@rspack/binding': 1.0.5 '@rspack/lite-tapable': 1.0.0 caniuse-lite: 1.0.30001660 optionalDependencies: diff --git a/website/package.json b/website/package.json index cc130ca7a..07b3bcf85 100644 --- a/website/package.json +++ b/website/package.json @@ -9,7 +9,7 @@ "preview": "rspress preview" }, "devDependencies": { - "@rsbuild/core": "1.0.2", + "@rsbuild/core": "1.0.3", "@rslib/tsconfig": "workspace:*", "@rstack-dev/doc-ui": "1.5.0", "@types/node": "~18.19.39", From c43bedb5a1a0aa2e273fdf3164522fdbfb357f1d Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Fri, 13 Sep 2024 18:44:07 +0800 Subject: [PATCH 2/2] chore: update --- e2e/cases/auto-external/index.test.ts | 8 ++++---- e2e/cases/bundle-false/index.test.ts | 8 ++++---- e2e/cases/externals/index.test.ts | 6 +++--- e2e/cases/resolve/index.test.ts | 2 +- e2e/cases/transform-import/index.test.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/e2e/cases/auto-external/index.test.ts b/e2e/cases/auto-external/index.test.ts index 1e59a3287..529286bcb 100644 --- a/e2e/cases/auto-external/index.test.ts +++ b/e2e/cases/auto-external/index.test.ts @@ -13,7 +13,7 @@ test('auto external default should works', async () => { ); expect(js!.entries.cjs).toContain( - 'var external_react_namespaceObject = require("react");', + 'const external_react_namespaceObject = require("react");', ); // dts should externalized @@ -33,10 +33,10 @@ test('auto external sub path should works', async () => { ); expect(entries.cjs).toContain( - 'var external_react_namespaceObject = require("react");', + 'const external_react_namespaceObject = require("react");', ); expect(entries.cjs).toContain( - 'var jsx_runtime_namespaceObject = require("react/jsx-runtime");', + 'const jsx_runtime_namespaceObject = require("react/jsx-runtime");', ); }); @@ -66,7 +66,7 @@ test('externals should overrides auto external', async () => { ); expect(entries.cjs).toContain( - 'var external_react1_namespaceObject = require("react1");', + 'const external_react1_namespaceObject = require("react1");', ); }); diff --git a/e2e/cases/bundle-false/index.test.ts b/e2e/cases/bundle-false/index.test.ts index 96d1dd4f8..55c5d229c 100644 --- a/e2e/cases/bundle-false/index.test.ts +++ b/e2e/cases/bundle-false/index.test.ts @@ -54,10 +54,10 @@ test('auto add extension for relative import', async () => { } for (const requirer of [ - 'var external_bar_cjs_namespaceObject = require("./bar.cjs");', - 'var external_baz_cjs_namespaceObject = require("./baz.cjs");', - 'var external_foo_cjs_namespaceObject = require("./foo.cjs");', - 'var external_qux_cjs_namespaceObject = require("./qux.cjs");', + 'const external_bar_cjs_namespaceObject = require("./bar.cjs");', + 'const external_baz_cjs_namespaceObject = require("./baz.cjs");', + 'const external_foo_cjs_namespaceObject = require("./foo.cjs");', + 'const external_qux_cjs_namespaceObject = require("./qux.cjs");', ]) { expect(Object.values(contents.cjs)[3]).toContain(requirer); } diff --git a/e2e/cases/externals/index.test.ts b/e2e/cases/externals/index.test.ts index 583c43ad9..9dfd2e436 100644 --- a/e2e/cases/externals/index.test.ts +++ b/e2e/cases/externals/index.test.ts @@ -25,9 +25,9 @@ test('auto externalize Node.js built-in modules when `output.target` is "node"', } for (const external of [ - 'var external_fs_namespaceObject = require("fs");', - 'var external_node_assert_namespaceObject = require("node:assert");', - 'var external_react_namespaceObject = require("react");', + 'const external_fs_namespaceObject = require("fs");', + 'const external_node_assert_namespaceObject = require("node:assert");', + 'const external_react_namespaceObject = require("react");', 'module.exports = require("bar");', 'module.exports = require("foo");', ]) { diff --git a/e2e/cases/resolve/index.test.ts b/e2e/cases/resolve/index.test.ts index 7da583cae..0eba363fa 100644 --- a/e2e/cases/resolve/index.test.ts +++ b/e2e/cases/resolve/index.test.ts @@ -31,7 +31,7 @@ test('resolve node protocol', async () => { expect(isSuccess).toBeTruthy(); expect(entries.esm).toMatchInlineSnapshot(` "import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path"; - var external_node_path_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_path__; + const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_path__; const { join } = external_node_path_namespaceObject["default"]; export { join }; " diff --git a/e2e/cases/transform-import/index.test.ts b/e2e/cases/transform-import/index.test.ts index a38de78e6..8327169eb 100644 --- a/e2e/cases/transform-import/index.test.ts +++ b/e2e/cases/transform-import/index.test.ts @@ -11,7 +11,7 @@ test('transformImport with arco-design', async () => { 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"' - : 'var button_namespaceObject = require("@arco-design/web-react/es/button")', + : 'const button_namespaceObject = require("@arco-design/web-react/es/button")', ); expect(Object.values(contents[format]!)[0]).toContain( format.startsWith('esm') @@ -30,12 +30,12 @@ test('transformImport with lodash', async () => { expect(Object.values(contents[format]!)[0]).toContain( format.startsWith('esm') ? 'import * as __WEBPACK_EXTERNAL_MODULE_lodash_get__ from "lodash/get"' - : 'var get_namespaceObject = require("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"' - : 'var add_namespaceObject = require("lodash/fp/add")', + : 'const add_namespaceObject = require("lodash/fp/add")', ); } });