diff --git a/package.json b/package.json index a0a44c8..ac5e1ce 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@biomejs/biome": "^2.2.4", "@playwright/test": "^1.55.1", - "@rsbuild/core": "^1.5.13", + "@rsbuild/core": "^1.6.0-beta.0", "@rsbuild/plugin-react": "^1.4.1", "@rslib/core": "^0.15.0", "@types/node": "^22.18.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 731a09b..1d75b92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,11 +15,11 @@ importers: specifier: ^1.55.1 version: 1.55.1 '@rsbuild/core': - specifier: ^1.5.13 - version: 1.5.13 + specifier: ^1.6.0-beta.0 + version: 1.6.0-beta.0 '@rsbuild/plugin-react': specifier: ^1.4.1 - version: 1.4.1(@rsbuild/core@1.5.13) + version: 1.4.1(@rsbuild/core@1.6.0-beta.0) '@rslib/core': specifier: ^0.15.0 version: 0.15.0(typescript@5.9.3) @@ -170,24 +170,45 @@ packages: '@module-federation/error-codes@0.18.0': resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==} + '@module-federation/error-codes@0.20.0': + resolution: {integrity: sha512-pwKqIFXHG72AaXjtptZb+l5VOO3O7JQMVZ4txFhBH4H/BMu7o1LRBONllTisVmojLHOC/RQpBrxXSGrC64LC4w==} + '@module-federation/runtime-core@0.18.0': resolution: {integrity: sha512-ZyYhrDyVAhUzriOsVfgL6vwd+5ebYm595Y13KeMf6TKDRoUHBMTLGQ8WM4TDj8JNsy7LigncK8C03fn97of0QQ==} + '@module-federation/runtime-core@0.20.0': + resolution: {integrity: sha512-M/0F/Ed6o1eCC5gKW3V3QtbxeNZ1w0Y7r6NKNacnwKKC12Nn7Ty9Rg1Kjw2B13EUqP8Qs2Y2IwmBEApy7cFLMw==} + '@module-federation/runtime-tools@0.18.0': resolution: {integrity: sha512-fSga9o4t1UfXNV/Kh6qFvRyZpPp3EHSPRISNeyT8ZoTpzDNiYzhtw0BPUSSD8m6C6XQh2s/11rI4g80UY+d+hA==} + '@module-federation/runtime-tools@0.20.0': + resolution: {integrity: sha512-5NimrYQyYr8hBl48YVU+w6bzl9uWDKNq3IEqYDgYljTYlupbVqsH2MJTf2A+c95nuCycjHS0vp5B3rnJ3Kdotg==} + '@module-federation/runtime@0.18.0': resolution: {integrity: sha512-+C4YtoSztM7nHwNyZl6dQKGUVJdsPrUdaf3HIKReg/GQbrt9uvOlUWo2NXMZ8vDAnf/QRrpSYAwXHmWDn9Obaw==} + '@module-federation/runtime@0.20.0': + resolution: {integrity: sha512-9vHE27aLCWbvzUfYWCTCsNbx4IQ5MtK3f340s4swQofTKj0Qv5dJ6gRIwmHk3DqvH5/1FZoQi3FYMCmrThiGrg==} + '@module-federation/sdk@0.18.0': resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==} + '@module-federation/sdk@0.20.0': + resolution: {integrity: sha512-bBFGA07PpfioJLY0DITVe+szGwLtFad+8R4rb5bPFKCZPZsKqLKwMB9tSsdHeieFPSc+1v20s6wq+R1DiWe56Q==} + '@module-federation/webpack-bundler-runtime@0.18.0': resolution: {integrity: sha512-TEvErbF+YQ+6IFimhUYKK3a5wapD90d90sLsNpcu2kB3QGT7t4nIluE25duXuZDVUKLz86tEPrza/oaaCWTpvQ==} + '@module-federation/webpack-bundler-runtime@0.20.0': + resolution: {integrity: sha512-TB0v5FRjfpL5fR8O5L4L3FTKJsb4EsflK8aNkdrJ46Tm/MR+PvL4SEx/AXpnsY+g/zkGRkiz10vwF0/RgMh6fQ==} + '@napi-rs/wasm-runtime@1.0.5': resolution: {integrity: sha512-TBr9Cf9onSAS2LQ2+QHx6XcC6h9+RIzJgbqG3++9TUZSH204AwEy5jg3BTQ0VATsyoGj4ee49tN/y6rvaOOtcg==} + '@napi-rs/wasm-runtime@1.0.7': + resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==} + '@playwright/test@1.55.1': resolution: {integrity: sha512-IVAh/nOJaw6W9g+RJVlIQJ6gSiER+ae6mKQ5CX1bERzQgbC1VSeBlwdvczT7pxb0GWiyrxH4TGKbMfDb4Sq/ig==} engines: {node: '>=18'} @@ -198,6 +219,11 @@ packages: engines: {node: '>=18.12.0'} hasBin: true + '@rsbuild/core@1.6.0-beta.0': + resolution: {integrity: sha512-NIp8w1/Zho+IZDwuqJIZoMH1vD2srbGQT0OGR8FGgn05MVt3ktsdxv6NOR7WynQGiPXztVluSAIBYSFKJDjecQ==} + engines: {node: '>=18.12.0'} + hasBin: true + '@rsbuild/plugin-react@1.4.1': resolution: {integrity: sha512-kahvnfRPQTsG0tReR6h0KuVfyjKJfpv/PoU5qW5SDkON7vmbGn8Jx7l3fI+yU3lR/7qDiAO19QnNjkqxPsFT3Q==} peerDependencies: @@ -221,53 +247,105 @@ packages: cpu: [arm64] os: [darwin] + '@rspack/binding-darwin-arm64@1.6.0-beta.0': + resolution: {integrity: sha512-iRza6XmLT0obDwlaFvZ/LUJ3FqbcZnwA48C1bwCUlDnM+9uVFInCrcHkOjKuXnNcWBBJvNmLDWA5XYWzjtbXsw==} + cpu: [arm64] + os: [darwin] + '@rspack/binding-darwin-x64@1.5.8': resolution: {integrity: sha512-YFOzeL1IBknBcri8vjUp43dfUBylCeQnD+9O9p0wZmLAw7DtpN5JEOe2AkGo8kdTqJjYKI+cczJPKIw6lu1LWw==} cpu: [x64] os: [darwin] + '@rspack/binding-darwin-x64@1.6.0-beta.0': + resolution: {integrity: sha512-4rHw6IHpWO04C22lEQK34vk6H+CtBkVQK9pEoA4gr+zMX8H+Bfl8liVQgeaAgwRqD7ipDo3jXGLaakVGktDexw==} + cpu: [x64] + os: [darwin] + '@rspack/binding-linux-arm64-gnu@1.5.8': resolution: {integrity: sha512-UAWCsOnpkvy8eAVRo0uipbHXDhnoDq5zmqWTMhpga0/a3yzCp2e+fnjZb/qnFNYb5MeL0O1mwMOYgn1M3oHILQ==} cpu: [arm64] os: [linux] + '@rspack/binding-linux-arm64-gnu@1.6.0-beta.0': + resolution: {integrity: sha512-ww45NhAOreOYRFpjf1TYRvNQYLOMr/LodFZA1yI5MLRCSYMgvWuv6B1WIY7o3pLaGWeY/H+zf89JTpR2rNn25g==} + cpu: [arm64] + os: [linux] + '@rspack/binding-linux-arm64-musl@1.5.8': resolution: {integrity: sha512-GnSvGT4GjokPSD45cTtE+g7LgghuxSP1MRmvd+Vp/I8pnxTVSTsebRod4TAqyiv+l11nuS8yqNveK9qiOkBLWw==} cpu: [arm64] os: [linux] + '@rspack/binding-linux-arm64-musl@1.6.0-beta.0': + resolution: {integrity: sha512-nxkqLF8vz62NR65wxxMpdRDXce6q36R3BHvibyXlElSbSPSPL0n7gsOW2yMeCB5q812DRkzm2c9RNkpQ8nfXwQ==} + cpu: [arm64] + os: [linux] + '@rspack/binding-linux-x64-gnu@1.5.8': resolution: {integrity: sha512-XLxh5n/pzUfxsugz/8rVBv+Tx2nqEM+9rharK69kfooDsQNKyz7PANllBQ/v4svJ+W0BRHnDL4qXSGdteZeEjA==} cpu: [x64] os: [linux] + '@rspack/binding-linux-x64-gnu@1.6.0-beta.0': + resolution: {integrity: sha512-xfOzI6+TeLZFJ8I1siOguIlyf5m0ABWPAStPY2Wm4EIEhJz+dr5PTWa5V6DlXZkUfV/6E5ZAQGZmgcgOR+DPHw==} + cpu: [x64] + os: [linux] + '@rspack/binding-linux-x64-musl@1.5.8': resolution: {integrity: sha512-gE0+MZmwF+01p9/svpEESkzkLpBkVUG2o03YMpwXYC/maeRRhWvF8BJ7R3i/Ls/jFGSE87dKX5NbRLVzqksq/w==} cpu: [x64] os: [linux] + '@rspack/binding-linux-x64-musl@1.6.0-beta.0': + resolution: {integrity: sha512-OauuEH2P4ZXQ6vCnNZZocmxUJCTdmyUyZYHBzd+cK62uGzXcGGBp+R74grfmwThL+b4rFI2IupxMCLcDOop0zg==} + cpu: [x64] + os: [linux] + '@rspack/binding-wasm32-wasi@1.5.8': resolution: {integrity: sha512-cfg3niNHeJuxuml1Vy9VvaJrI/5TakzoaZvKX2g5S24wfzR50Eyy4JAsZ+L2voWQQp1yMJbmPYPmnTCTxdJQBQ==} cpu: [wasm32] + '@rspack/binding-wasm32-wasi@1.6.0-beta.0': + resolution: {integrity: sha512-0sSaIM39lSNthIvZsDA7WDnwdP4/4rRH4QyN4/DLUOCdci5xUSUSz/MsRXA+smI41qu4sh9yU/jRT8pq9bSWAQ==} + cpu: [wasm32] + '@rspack/binding-win32-arm64-msvc@1.5.8': resolution: {integrity: sha512-7i3ZTHFXKfU/9Jm9XhpMkrdkxO7lfeYMNVEGkuU5dyBfRMQj69dRgPL7zJwc2plXiqu9LUOl+TwDNTjap7Q36g==} cpu: [arm64] os: [win32] + '@rspack/binding-win32-arm64-msvc@1.6.0-beta.0': + resolution: {integrity: sha512-QqtnwHhpst37I3eQtx1FqpWCQCkigg2M73QUDvjhCE+opb1X46XK+kZOyt5qO0fKRdOgtxTcTVLLzRUWuT4t4A==} + cpu: [arm64] + os: [win32] + '@rspack/binding-win32-ia32-msvc@1.5.8': resolution: {integrity: sha512-7ZPPWO11J+soea1+mnfaPpQt7GIodBM7A86dx6PbXgVEoZmetcWPrCF2NBfXxQWOKJ9L3RYltC4z+ZyXRgMOrw==} cpu: [ia32] os: [win32] + '@rspack/binding-win32-ia32-msvc@1.6.0-beta.0': + resolution: {integrity: sha512-Bi8fcihGY8QEgo+u8S3JeD41OLIs1/b4lYYAKOUVmpwJeN0lTlT7oMVikD2bLLpPs+gUkinTeeoUjwx0YWlGlA==} + cpu: [ia32] + os: [win32] + '@rspack/binding-win32-x64-msvc@1.5.8': resolution: {integrity: sha512-N/zXQgzIxME3YUzXT8qnyzxjqcnXudWOeDh8CAG9zqTCnCiy16SFfQ/cQgEoLlD9geQntV6jx2GbDDI5kpDGMQ==} cpu: [x64] os: [win32] + '@rspack/binding-win32-x64-msvc@1.6.0-beta.0': + resolution: {integrity: sha512-h7EltjtoAI2ohKxurD09uoXoe94nHiqcozca4Z7sB+f1RaBnc9U3RmddCVkENGZ2YFDx77fC6bayu2WkdY2YIw==} + cpu: [x64] + os: [win32] + '@rspack/binding@1.5.8': resolution: {integrity: sha512-/91CzhRl9r5BIQCgGsS7jA6MDbw1I2BQpbfcUUdkdKl2P79K3Zo/Mw/TvKzS86catwLaUQEgkGRmYawOfPg7ow==} + '@rspack/binding@1.6.0-beta.0': + resolution: {integrity: sha512-8CoJCSkWhhgAcmymvkvXb6fHV1zfRnx68mW/tFD/pN2BzwLrAqzvq9PUhJw0MLq4Dg+RIYG6xjzDDp3fkt574Q==} + '@rspack/core@1.5.8': resolution: {integrity: sha512-sUd2LfiDhqYVfvknuoz0+/c+wSpn693xotnG5g1CSWKZArbtwiYzBIVnNlcHGmuoBRsnj/TkSq8dTQ7gwfBroQ==} engines: {node: '>=18.12.0'} @@ -277,6 +355,15 @@ packages: '@swc/helpers': optional: true + '@rspack/core@1.6.0-beta.0': + resolution: {integrity: sha512-wrGg90zjX5/cf2hKh2La0q3++twOBnk6z2WkWWcd1Jz5F9OcbHWyn+9yGHJI921A0AziC0pv7P1MmucmG3e7fA==} + engines: {node: '>=18.12.0'} + peerDependencies: + '@swc/helpers': '>=0.5.1' + peerDependenciesMeta: + '@swc/helpers': + optional: true + '@rspack/lite-tapable@1.0.1': resolution: {integrity: sha512-VynGOEsVw2s8TAlLf/uESfrgfrq2+rcXB1muPJYBWbsm1Oa6r5qVQhjA5ggM6z/coYPrsVMgovl3Ff7Q7OCp1w==} engines: {node: '>=16.0.0'} @@ -302,6 +389,9 @@ packages: core-js@3.45.1: resolution: {integrity: sha512-L4NPsJlCfZsPeXukyzHFlg/i7IIVwHSItR0wg0FLNqYClJ4MQYTYLbC7EkjKYRLZF2iof2MUgN0EGy7MdQFChg==} + core-js@3.46.0: + resolution: {integrity: sha512-vDMm9B0xnqqZ8uSBpZ8sNtRtOdmfShrvT6h2TuQGLs0Is+cR0DYbj/KWP6ALVNbWPpqA/qPLoOuppJN07humpA==} + error-stack-parser@2.1.4: resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==} @@ -317,6 +407,10 @@ packages: resolution: {integrity: sha512-VXe6RjJkBPj0ohtqaO8vSWP3ZhAKo66fKrFNCll4BTcwljPLz03pCbaNKfzGP5MbrCYcbJ7v0nOYYwUzTEIdXQ==} hasBin: true + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} + hasBin: true + nano-staged@0.8.0: resolution: {integrity: sha512-QSEqPGTCJbkHU2yLvfY6huqYPjdBrOaTMKatO1F8nCSrkQGXeKwtCiCnsdxnuMhbg3DTVywKaeWLGCE5oJpq0g==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -479,29 +573,54 @@ snapshots: '@module-federation/error-codes@0.18.0': {} + '@module-federation/error-codes@0.20.0': {} + '@module-federation/runtime-core@0.18.0': dependencies: '@module-federation/error-codes': 0.18.0 '@module-federation/sdk': 0.18.0 + '@module-federation/runtime-core@0.20.0': + dependencies: + '@module-federation/error-codes': 0.20.0 + '@module-federation/sdk': 0.20.0 + '@module-federation/runtime-tools@0.18.0': dependencies: '@module-federation/runtime': 0.18.0 '@module-federation/webpack-bundler-runtime': 0.18.0 + '@module-federation/runtime-tools@0.20.0': + dependencies: + '@module-federation/runtime': 0.20.0 + '@module-federation/webpack-bundler-runtime': 0.20.0 + '@module-federation/runtime@0.18.0': dependencies: '@module-federation/error-codes': 0.18.0 '@module-federation/runtime-core': 0.18.0 '@module-federation/sdk': 0.18.0 + '@module-federation/runtime@0.20.0': + dependencies: + '@module-federation/error-codes': 0.20.0 + '@module-federation/runtime-core': 0.20.0 + '@module-federation/sdk': 0.20.0 + '@module-federation/sdk@0.18.0': {} + '@module-federation/sdk@0.20.0': {} + '@module-federation/webpack-bundler-runtime@0.18.0': dependencies: '@module-federation/runtime': 0.18.0 '@module-federation/sdk': 0.18.0 + '@module-federation/webpack-bundler-runtime@0.20.0': + dependencies: + '@module-federation/runtime': 0.20.0 + '@module-federation/sdk': 0.20.0 + '@napi-rs/wasm-runtime@1.0.5': dependencies: '@emnapi/core': 1.5.0 @@ -509,6 +628,13 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true + '@napi-rs/wasm-runtime@1.0.7': + dependencies: + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 + '@tybys/wasm-util': 0.10.1 + optional: true + '@playwright/test@1.55.1': dependencies: playwright: 1.55.1 @@ -521,9 +647,17 @@ snapshots: core-js: 3.45.1 jiti: 2.6.0 - '@rsbuild/plugin-react@1.4.1(@rsbuild/core@1.5.13)': + '@rsbuild/core@1.6.0-beta.0': dependencies: - '@rsbuild/core': 1.5.13 + '@rspack/core': 1.6.0-beta.0(@swc/helpers@0.5.17) + '@rspack/lite-tapable': 1.0.1 + '@swc/helpers': 0.5.17 + core-js: 3.46.0 + jiti: 2.6.1 + + '@rsbuild/plugin-react@1.4.1(@rsbuild/core@1.6.0-beta.0)': + dependencies: + '@rsbuild/core': 1.6.0-beta.0 '@rspack/plugin-react-refresh': 1.5.1(react-refresh@0.17.0) react-refresh: 0.17.0 transitivePeerDependencies: @@ -541,35 +675,67 @@ snapshots: '@rspack/binding-darwin-arm64@1.5.8': optional: true + '@rspack/binding-darwin-arm64@1.6.0-beta.0': + optional: true + '@rspack/binding-darwin-x64@1.5.8': optional: true + '@rspack/binding-darwin-x64@1.6.0-beta.0': + optional: true + '@rspack/binding-linux-arm64-gnu@1.5.8': optional: true + '@rspack/binding-linux-arm64-gnu@1.6.0-beta.0': + optional: true + '@rspack/binding-linux-arm64-musl@1.5.8': optional: true + '@rspack/binding-linux-arm64-musl@1.6.0-beta.0': + optional: true + '@rspack/binding-linux-x64-gnu@1.5.8': optional: true + '@rspack/binding-linux-x64-gnu@1.6.0-beta.0': + optional: true + '@rspack/binding-linux-x64-musl@1.5.8': optional: true + '@rspack/binding-linux-x64-musl@1.6.0-beta.0': + optional: true + '@rspack/binding-wasm32-wasi@1.5.8': dependencies: '@napi-rs/wasm-runtime': 1.0.5 optional: true + '@rspack/binding-wasm32-wasi@1.6.0-beta.0': + dependencies: + '@napi-rs/wasm-runtime': 1.0.7 + optional: true + '@rspack/binding-win32-arm64-msvc@1.5.8': optional: true + '@rspack/binding-win32-arm64-msvc@1.6.0-beta.0': + optional: true + '@rspack/binding-win32-ia32-msvc@1.5.8': optional: true + '@rspack/binding-win32-ia32-msvc@1.6.0-beta.0': + optional: true + '@rspack/binding-win32-x64-msvc@1.5.8': optional: true + '@rspack/binding-win32-x64-msvc@1.6.0-beta.0': + optional: true + '@rspack/binding@1.5.8': optionalDependencies: '@rspack/binding-darwin-arm64': 1.5.8 @@ -583,6 +749,19 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.5.8 '@rspack/binding-win32-x64-msvc': 1.5.8 + '@rspack/binding@1.6.0-beta.0': + optionalDependencies: + '@rspack/binding-darwin-arm64': 1.6.0-beta.0 + '@rspack/binding-darwin-x64': 1.6.0-beta.0 + '@rspack/binding-linux-arm64-gnu': 1.6.0-beta.0 + '@rspack/binding-linux-arm64-musl': 1.6.0-beta.0 + '@rspack/binding-linux-x64-gnu': 1.6.0-beta.0 + '@rspack/binding-linux-x64-musl': 1.6.0-beta.0 + '@rspack/binding-wasm32-wasi': 1.6.0-beta.0 + '@rspack/binding-win32-arm64-msvc': 1.6.0-beta.0 + '@rspack/binding-win32-ia32-msvc': 1.6.0-beta.0 + '@rspack/binding-win32-x64-msvc': 1.6.0-beta.0 + '@rspack/core@1.5.8(@swc/helpers@0.5.17)': dependencies: '@module-federation/runtime-tools': 0.18.0 @@ -591,6 +770,14 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.17 + '@rspack/core@1.6.0-beta.0(@swc/helpers@0.5.17)': + dependencies: + '@module-federation/runtime-tools': 0.20.0 + '@rspack/binding': 1.6.0-beta.0 + '@rspack/lite-tapable': 1.0.1 + optionalDependencies: + '@swc/helpers': 0.5.17 + '@rspack/lite-tapable@1.0.1': {} '@rspack/plugin-react-refresh@1.5.1(react-refresh@0.17.0)': @@ -614,6 +801,8 @@ snapshots: core-js@3.45.1: {} + core-js@3.46.0: {} + error-stack-parser@2.1.4: dependencies: stackframe: 1.3.4 @@ -625,6 +814,8 @@ snapshots: jiti@2.6.0: {} + jiti@2.6.1: {} + nano-staged@0.8.0: dependencies: picocolors: 1.0.0 diff --git a/src/index.ts b/src/index.ts index 6eb2a81..4549d6f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,18 +21,21 @@ export const pluginUmd = (options: PluginUmdOptions): RsbuildPlugin => ({ const userConfig = api.getRsbuildConfig('original'); const userEnvConfig = userConfig.environments?.[name]; + const userDistPath = { + ...(typeof userConfig.output?.distPath === 'string' + ? {} + : userConfig.output?.distPath), + ...(typeof userEnvConfig?.output?.distPath === 'string' + ? {} + : userEnvConfig?.output?.distPath), + }; + // user environment config > user common config > umd default config return mergeEnvironmentConfig(config, { output: { distPath: { - js: - userEnvConfig?.output?.distPath?.js ?? - userConfig.output?.distPath?.js ?? - '', - css: - userEnvConfig?.output?.distPath?.css ?? - userConfig.output?.distPath?.css ?? - '', + js: userDistPath.js ?? '', + css: userDistPath.css ?? '', }, filenameHash: userEnvConfig?.output?.filenameHash ??