From e94101be94c8bb6e46af9e78941f5ef474ff4004 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 30 Oct 2025 17:20:30 +0800 Subject: [PATCH] feat: introduce `experiments.advancedEsm` with Rspack's EsmLibraryPlugin --- .github/workflows/preview.yml | 6 + .github/workflows/reusable-test.yml | 4 + .github/workflows/test.yml | 11 + examples/express-plugin/rslib.config.ts | 3 + .../mf-react-component/rslib.config.ts | 3 + .../react-component-bundle/rslib.config.ts | 3 + .../solid-component-bundle/rslib.config.ts | 3 + examples/vue-component-bundle/rslib.config.ts | 9 +- .../vue-component-bundleless/rslib.config.ts | 7 +- package.json | 7 +- packages/core/src/config.ts | 19 +- packages/core/src/types/config.ts | 15 + .../tests/__snapshots__/config.test.ts.snap | 710 +++++++++++++++++- packages/core/tests/config.test.ts | 20 + pnpm-lock.yaml | 585 ++++----------- pnpm-workspace.yaml | 1 + tests/integration/asset/index.test.ts | 73 +- .../integration/auto-extension/index.test.ts | 36 +- tests/integration/copy/index.test.ts | 46 +- tests/integration/entry/index.test.ts | 91 ++- tests/integration/entry/multiple/src/foo.ts | 2 +- tests/integration/entry/multiple/src/index.ts | 2 +- .../integration/entry/multiple/src/shared.ts | 4 +- .../__fixtures__/src/index.ts | 2 +- .../__snapshots__/index.test.ts.snap | 10 +- .../integration/format/esm-eval/package.json | 6 + .../format/esm-eval/rslib.config.ts | 6 + .../integration/format/esm-eval/src/index.ts | 5 + tests/integration/format/index.test.ts | 14 + tests/integration/json/index.test.ts | 27 +- tests/integration/minify/index.test.ts | 21 +- tests/integration/resolve/index.test.ts | 51 +- .../style/css-modules-named/index.test.ts | 88 +++ tests/integration/vue/index.test.ts | 102 ++- tests/package.json | 1 + tests/playwright.config.ts | 2 +- tests/scripts/shared.ts | 3 + website/docs/en/config/lib/_meta.json | 3 +- website/docs/en/config/lib/experiments.mdx | 28 + website/docs/en/config/lib/format.mdx | 5 + website/docs/zh/config/lib/_meta.json | 3 +- website/docs/zh/config/lib/experiments.mdx | 28 + website/docs/zh/config/lib/format.mdx | 5 + 43 files changed, 1512 insertions(+), 558 deletions(-) create mode 100644 tests/integration/format/esm-eval/package.json create mode 100644 tests/integration/format/esm-eval/rslib.config.ts create mode 100644 tests/integration/format/esm-eval/src/index.ts create mode 100644 tests/integration/style/css-modules-named/index.test.ts create mode 100644 website/docs/en/config/lib/experiments.mdx create mode 100644 website/docs/zh/config/lib/experiments.mdx diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 3443e7db4..2946f0c6b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -5,6 +5,11 @@ on: push: branches: [main] workflow_dispatch: + inputs: + branch: + description: 'Branch to release' + required: true + default: 'main' permissions: contents: read @@ -19,6 +24,7 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 1 + ref: ${{ github.event.inputs.branch }} - name: Install pnpm run: | diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 6ca913397..b58ea2a4d 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -92,6 +92,10 @@ jobs: if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'integration' }} run: pnpm run test:integration + - name: Integration Test with Advanced ESM (Rstest) + if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'integration-advanced-esm' }} + run: pnpm run test:integration:advanced-esm + - name: E2E Test (Playwright) if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'e2e' }} run: pnpm run test:e2e diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 620c7d9f9..4842f85f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,17 @@ jobs: node-version: ${{ matrix.node-version }} task: integration + integration-advanced-esm: + strategy: + matrix: + runner: [ubuntu-latest, windows-latest] + node-version: [22] + uses: ./.github/workflows/reusable-test.yml + with: + runner: ${{ matrix.runner }} + node-version: ${{ matrix.node-version }} + task: integration-advanced-esm + e2e: strategy: matrix: diff --git a/examples/express-plugin/rslib.config.ts b/examples/express-plugin/rslib.config.ts index 25974387c..b2028fe6e 100644 --- a/examples/express-plugin/rslib.config.ts +++ b/examples/express-plugin/rslib.config.ts @@ -8,6 +8,9 @@ export default defineConfig({ output: { distPath: './dist/esm', }, + experiments: { + advancedEsm: true, + }, }, { format: 'cjs', diff --git a/examples/module-federation/mf-react-component/rslib.config.ts b/examples/module-federation/mf-react-component/rslib.config.ts index 11249c969..ee240b87d 100644 --- a/examples/module-federation/mf-react-component/rslib.config.ts +++ b/examples/module-federation/mf-react-component/rslib.config.ts @@ -10,6 +10,9 @@ export default defineConfig({ output: { distPath: './dist/esm', }, + experiments: { + advancedEsm: true, + }, }, { format: 'cjs', diff --git a/examples/react-component-bundle/rslib.config.ts b/examples/react-component-bundle/rslib.config.ts index 4ecfbef90..acec6690c 100644 --- a/examples/react-component-bundle/rslib.config.ts +++ b/examples/react-component-bundle/rslib.config.ts @@ -10,6 +10,9 @@ export default defineConfig({ output: { distPath: './dist/esm', }, + experiments: { + advancedEsm: true, + }, }, { format: 'cjs', diff --git a/examples/solid-component-bundle/rslib.config.ts b/examples/solid-component-bundle/rslib.config.ts index 117731969..62b45e54d 100644 --- a/examples/solid-component-bundle/rslib.config.ts +++ b/examples/solid-component-bundle/rslib.config.ts @@ -8,6 +8,9 @@ export default defineConfig({ { format: 'esm', dts: true, + experiments: { + advancedEsm: true, + }, }, ], output: { diff --git a/examples/vue-component-bundle/rslib.config.ts b/examples/vue-component-bundle/rslib.config.ts index b219ef334..d03cb3da8 100644 --- a/examples/vue-component-bundle/rslib.config.ts +++ b/examples/vue-component-bundle/rslib.config.ts @@ -3,7 +3,14 @@ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue'; export default defineConfig({ plugins: [pluginUnpluginVue()], - lib: [{ format: 'esm' }], + lib: [ + { + format: 'esm', + experiments: { + advancedEsm: true, + }, + }, + ], output: { target: 'web', }, diff --git a/examples/vue-component-bundleless/rslib.config.ts b/examples/vue-component-bundleless/rslib.config.ts index ff777ed60..47b23a268 100644 --- a/examples/vue-component-bundleless/rslib.config.ts +++ b/examples/vue-component-bundleless/rslib.config.ts @@ -3,7 +3,12 @@ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue'; export default defineConfig({ plugins: [pluginUnpluginVue()], - lib: [{ bundle: false, format: 'esm' }], + lib: [ + { + format: 'esm', + bundle: false, + }, + ], output: { target: 'web', }, diff --git a/package.json b/package.json index f445767ce..917d8e2ad 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,14 @@ "prebundle": "nx run-many -t prebundle", "prepare": "pnpm run build && simple-git-hooks", "sort-package-json": "npx sort-package-json \"packages/*/package.json\"", - "test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:e2e", + "test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:integration:advanced-esm && pnpm run test:e2e", "test:benchmark": "cd ./tests && pnpm run test:benchmark", "test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e", - "test:ecosystem-ci": "pnpm run test:unit && cross-env ECO_CI=1 pnpm run test:integration && pnpm run test:e2e", + "test:ecosystem-ci": "pnpm run test:unit && cross-env ECO_CI=1 pnpm run test:integration && cross-env ECO_CI=1 pnpm run test:integration:advanced-esm && pnpm run test:e2e", "test:integration": "rstest run --project integration", + "test:integration:advanced-esm": "cross-env ADVANCED_ESM=1 rstest run --project integration", "test:unit": "rstest run --project unit*", - "testu": "pnpm run test:unit -u && pnpm run test:integration -u", + "testu": "pnpm run test:unit -u && pnpm run test:integration -u && pnpm test:integration:advanced-esm -u", "type-check": "pnpm -r run type-check", "update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l", "watch": "pnpm build --watch" diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index ab22d11e5..0c0b8126a 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -607,12 +607,14 @@ const composeFormatConfig = ({ umdName, pkgJson, enabledShims, + advancedEsm, }: { format: Format; pkgJson: PkgJson; bundle?: boolean; umdName?: Rspack.LibraryName; enabledShims: DeepRequired; + advancedEsm: boolean; }): EnvironmentConfig => { const jsParserOptions: Record = { cjs: { @@ -632,6 +634,8 @@ const composeFormatConfig = ({ }, }; + const experimentalEsmOutput = bundle && format === 'esm' && advancedEsm; + // The built-in Rslib plugin will apply to all formats except the `mf` format. // The `mf` format functions more like an application than a library and requires additional webpack runtime. const plugins = [ @@ -639,7 +643,8 @@ const composeFormatConfig = ({ interceptApiPlugin: true, forceNodeShims: enabledShims.esm.__dirname || enabledShims.esm.__filename, }), - ]; + experimentalEsmOutput && new rspack.experiments.EsmLibraryPlugin(), + ].filter(Boolean); switch (format) { case 'esm': @@ -656,8 +661,10 @@ const composeFormatConfig = ({ }, }, optimization: { - concatenateModules: true, - sideEffects: 'flag', + // experimentalEsmOutput don't need concatenateModules + concatenateModules: !experimentalEsmOutput, + sideEffects: experimentalEsmOutput ? true : 'flag', + runtimeChunk: experimentalEsmOutput ? 'single' : undefined, avoidEntryIife: true, splitChunks: { // Splitted "sync" chunks will make entry modules can't be inlined. @@ -666,7 +673,7 @@ const composeFormatConfig = ({ }, output: { module: true, - chunkFormat: 'module', + chunkFormat: experimentalEsmOutput ? false : 'module', library: { type: 'modern-module', }, @@ -1732,7 +1739,9 @@ async function composeLibRsbuildConfig( externalHelpers = false, redirect = {}, umdName, + experiments, } = config; + const advancedEsm = experiments?.advancedEsm; const { rsbuildConfig: bundleConfig } = composeBundleConfig(bundle); const { rsbuildConfig: shimsConfig, enabledShims } = composeShimsConfig( format, @@ -1744,6 +1753,7 @@ async function composeLibRsbuildConfig( bundle, umdName, enabledShims, + advancedEsm: advancedEsm ?? false, }); const externalHelpersConfig = composeExternalHelpersConfig( externalHelpers, @@ -1933,6 +1943,7 @@ export async function composeCreateRsbuildConfig( shims: true, umdName: true, outBase: true, + experiments: true, }), ), }; diff --git a/packages/core/src/types/config.ts b/packages/core/src/types/config.ts index e00f2597f..e84a9bb6e 100644 --- a/packages/core/src/types/config.ts +++ b/packages/core/src/types/config.ts @@ -241,6 +241,15 @@ export type Redirect = { dts?: DtsRedirect; }; +export type LibExperiments = { + /** + * Whether to enable Rspack advanced ESM output. + * @defaultValue `false` + * @see {@link https://rslib.rs/config/lib/experiments#experimentsadvancedesm} + */ + advancedEsm?: boolean; +}; + export interface LibConfig extends EnvironmentConfig { /** * The unique identifier of the library. @@ -343,6 +352,12 @@ export interface LibConfig extends EnvironmentConfig { * @inheritdoc */ output?: RslibOutputConfig; + /** + * Options for experimental features. + * @defaultValue `{}` + * @see {@link https://rslib.rs/config/lib/experiments} + */ + experiments?: LibExperiments; } export type LibOnlyConfig = Omit; diff --git a/packages/core/tests/__snapshots__/config.test.ts.snap b/packages/core/tests/__snapshots__/config.test.ts.snap index 45379d254..a6aacde6f 100644 --- a/packages/core/tests/__snapshots__/config.test.ts.snap +++ b/packages/core/tests/__snapshots__/config.test.ts.snap @@ -1,5 +1,711 @@ // Rstest Snapshot v1 +exports[`Should compose create Rsbuild config correctly > Enable experiment.advancedEsm in esm format > experiment.advancedEsm Rspack configs 1`] = ` +[ + "{ + target: [ + 'es2022', + 'node' + ], + name: 'esm', + devtool: false, + context: '', + mode: 'production', + infrastructureLogging: { + level: 'error' + }, + watchOptions: { + aggregateTimeout: 0 + }, + experiments: { + inlineEnum: true, + inlineConst: true, + typeReexportsPresence: true, + rspackFuture: { + bundlerInfo: { + force: false + } + }, + asyncWebAssembly: true, + outputModule: true + }, + externals: [ + function () { /* omitted long function */ }, + /^@rsbuild\\/core($|\\/|\\\\)/, + /^rsbuild-plugin-dts($|\\/|\\\\)/, + /^@microsoft\\/api-extractor($|\\/|\\\\)/, + /^typescript($|\\/|\\\\)/, + '@rsbuild/core', + 'rsbuild-plugin-dts', + '@microsoft/api-extractor', + 'typescript', + 'assert', + 'assert/strict', + 'async_hooks', + 'buffer', + 'child_process', + 'cluster', + 'console', + 'constants', + 'crypto', + 'dgram', + 'diagnostics_channel', + 'dns', + 'dns/promises', + 'domain', + 'events', + 'fs', + 'fs/promises', + 'http', + 'http2', + 'https', + 'inspector', + 'inspector/promises', + 'module', + 'net', + 'os', + 'path', + 'path/posix', + 'path/win32', + 'perf_hooks', + 'process', + 'punycode', + 'querystring', + 'readline', + 'readline/promises', + 'repl', + 'stream', + 'stream/consumers', + 'stream/promises', + 'stream/web', + 'string_decoder', + 'sys', + 'timers', + 'timers/promises', + 'tls', + 'trace_events', + 'tty', + 'url', + 'util', + 'util/types', + 'v8', + 'vm', + 'wasi', + 'worker_threads', + 'zlib', + /^node:/, + 'pnpapi' + ], + output: { + path: '/dist', + filename: '[name].js', + chunkFilename: '[name].js', + publicPath: 'auto', + pathinfo: false, + hashFunction: 'xxhash64', + library: { + type: 'modern-module' + }, + assetModuleFilename: 'static/assets/[name][ext]', + webassemblyModuleFilename: 'static/wasm/[contenthash:8].module.wasm', + module: true, + chunkFormat: false, + chunkLoading: 'import', + workerChunkLoading: 'import' + }, + resolve: { + tsConfig: { + configFile: '/tsconfig.json', + references: 'auto' + }, + alias: { + '@swc/helpers': '/node_modules//@swc/helpers' + }, + extensionAlias: { + '.js': [ + '.js', + '.ts', + '.tsx', + '.ts', + '.tsx', + '.js', + '.jsx' + ], + '.jsx': [ + '.jsx', + '.tsx', + '.tsx', + '.jsx' + ], + '.mjs': [ + '.mts', + '.mjs' + ], + '.cjs': [ + '.cts', + '.cjs' + ] + }, + extensions: [ + '.ts', + '.tsx', + '.mjs', + '.js', + '.jsx', + '.json' + ] + }, + module: { + parser: { + javascript: { + exportsPresence: 'error', + inlineConst: true, + typeReexportsPresence: 'tolerant', + importMeta: false, + importDynamic: false, + commonjs: { + exports: 'skipInEsm' + }, + requireResolve: false, + requireDynamic: false, + requireAsExpression: false, + worker: false + } + }, + rules: [ + /* config.module.rule('mjs') */ + { + test: /\\.m?js/, + resolve: { + fullySpecified: false + } + }, + /* config.module.rule('css') */ + { + test: /\\.css$/, + type: 'javascript/auto', + dependency: { + not: 'url' + }, + resourceQuery: { + not: [ + /[?&]raw(?:&|=|$)/, + /[?&]inline(?:&|=|$)/ + ] + }, + sideEffects: true, + use: [ + /* config.module.rule('css').use('ignore-css') */ + { + loader: '/node_modules//@rsbuild/core/dist/ignoreCssLoader.mjs' + }, + /* config.module.rule('css').use('css') */ + { + loader: '/node_modules//@rsbuild/core/compiled/css-loader/index.js', + options: { + importLoaders: 0, + modules: { + auto: true, + namedExport: false, + exportGlobals: false, + exportLocalsConvention: 'camelCase', + localIdentName: '[local]-[hash:base64:6]', + exportOnlyLocals: true + }, + sourceMap: false + } + } + ], + resolve: { + preferRelative: true + } + }, + /* config.module.rule('css-inline') */ + { + test: /\\.css$/, + type: 'javascript/auto', + resourceQuery: /[?&]inline(?:&|=|$)/, + sideEffects: true, + use: [ + /* config.module.rule('css-inline').use('css') */ + { + loader: '/node_modules//@rsbuild/core/compiled/css-loader/index.js', + options: { + importLoaders: 0, + modules: false, + sourceMap: false, + exportType: 'string' + } + } + ], + resolve: { + preferRelative: true + } + }, + /* config.module.rule('css-raw') */ + { + test: /\\.css$/, + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('js') */ + { + test: /\\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, + dependency: { + not: 'url' + }, + resourceQuery: { + not: /[?&]raw(?:&|=|$)/ + }, + parser: { + url: false + }, + include: [ + { + not: /[\\\\/]node_modules[\\\\/]/ + }, + /\\.(?:ts|tsx|jsx|mts|cts)$/ + ], + use: [ + /* config.module.rule('js').use('swc') */ + { + loader: 'builtin:swc-loader', + options: { + jsc: { + externalHelpers: false, + parser: { + tsx: false, + syntax: 'typescript', + decorators: true + }, + experimental: { + cacheRoot: '/node_modules/.cache/.swc', + keepImportAttributes: true + }, + output: { + charset: 'utf8' + }, + transform: { + legacyDecorator: false, + decoratorVersion: '2022-03' + } + }, + isModule: 'unknown', + env: { + targets: [ + 'last 1 node versions' + ] + }, + rspackExperiments: { + collectTypeScriptInfo: { + typeExports: true, + exportedEnum: true + } + } + } + } + ] + }, + /* config.module.rule('js-raw') */ + { + test: /\\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('js-data-uri') */ + { + mimetype: { + or: [ + 'text/javascript', + 'application/javascript' + ] + }, + use: [ + /* config.module.rule('js-data-uri').use('swc') */ + { + loader: 'builtin:swc-loader', + options: { + jsc: { + externalHelpers: false, + parser: { + tsx: false, + syntax: 'typescript', + decorators: true + }, + experimental: { + cacheRoot: '/node_modules/.cache/.swc', + keepImportAttributes: true + }, + output: { + charset: 'utf8' + }, + transform: { + legacyDecorator: false, + decoratorVersion: '2022-03' + } + }, + isModule: 'unknown', + env: { + targets: [ + 'last 1 node versions' + ] + }, + rspackExperiments: { + collectTypeScriptInfo: { + typeExports: true, + exportedEnum: true + } + } + } + } + ], + resolve: { + fullySpecified: false + } + }, + /* config.module.rule('image') */ + { + test: /\\.(?:png|jpg|jpeg|pjpeg|pjp|gif|bmp|webp|ico|apng|avif|tif|tiff|jfif|cur)$/i, + oneOf: [ + /* config.module.rule('image').oneOf('image-asset-url') */ + { + type: 'asset/resource', + resourceQuery: /^\\?(__inline=false|url)$/, + generator: { + filename: 'static/image/[name][ext]' + } + }, + /* config.module.rule('image').oneOf('image-asset-inline') */ + { + type: 'asset/inline', + resourceQuery: /[?&]inline(?:&|=|$)/ + }, + /* config.module.rule('image').oneOf('image-asset-raw') */ + { + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('image').oneOf('image-asset') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/image/[name][ext]', + importMode: 'preserve' + }, + issuer: { + not: /\\.(css|sass|scss|less|styl|stylus)$/ + } + }, + /* config.module.rule('image').oneOf('image-asset-for-css') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/image/[name][ext]' + }, + issuer: /\\.(css|sass|scss|less|styl|stylus)$/ + } + ] + }, + /* config.module.rule('svg') */ + { + test: /\\.svg$/i, + oneOf: [ + /* config.module.rule('svg').oneOf('svg-asset-url') */ + { + type: 'asset/resource', + resourceQuery: /^\\?(__inline=false|url)$/, + generator: { + filename: 'static/svg/[name].svg' + } + }, + /* config.module.rule('svg').oneOf('svg-asset-inline') */ + { + type: 'asset/inline', + resourceQuery: /[?&]inline(?:&|=|$)/ + }, + /* config.module.rule('svg').oneOf('svg-asset-raw') */ + { + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('svg').oneOf('svg-asset') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/svg/[name].svg', + importMode: 'preserve' + }, + issuer: { + not: /\\.(css|sass|scss|less|styl|stylus)$/ + } + }, + /* config.module.rule('svg').oneOf('svg-asset-for-css') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/svg/[name].svg' + }, + issuer: /\\.(css|sass|scss|less|styl|stylus)$/ + }, + /* config.module.rule('svg').oneOf('svg') */ + {} + ] + }, + /* config.module.rule('media') */ + { + test: /\\.(?:mp4|webm|ogg|mov|mp3|wav|flac|aac|m4a|opus)$/i, + oneOf: [ + /* config.module.rule('media').oneOf('media-asset-url') */ + { + type: 'asset/resource', + resourceQuery: /^\\?(__inline=false|url)$/, + generator: { + filename: 'static/media/[name][ext]' + } + }, + /* config.module.rule('media').oneOf('media-asset-inline') */ + { + type: 'asset/inline', + resourceQuery: /[?&]inline(?:&|=|$)/ + }, + /* config.module.rule('media').oneOf('media-asset-raw') */ + { + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('media').oneOf('media-asset') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/media/[name][ext]', + importMode: 'preserve' + }, + issuer: { + not: /\\.(css|sass|scss|less|styl|stylus)$/ + } + }, + /* config.module.rule('media').oneOf('media-asset-for-css') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/media/[name][ext]' + }, + issuer: /\\.(css|sass|scss|less|styl|stylus)$/ + } + ] + }, + /* config.module.rule('font') */ + { + test: /\\.(?:woff|woff2|eot|ttf|otf|ttc)$/i, + oneOf: [ + /* config.module.rule('font').oneOf('font-asset-url') */ + { + type: 'asset/resource', + resourceQuery: /^\\?(__inline=false|url)$/, + generator: { + filename: 'static/font/[name][ext]' + } + }, + /* config.module.rule('font').oneOf('font-asset-inline') */ + { + type: 'asset/inline', + resourceQuery: /[?&]inline(?:&|=|$)/ + }, + /* config.module.rule('font').oneOf('font-asset-raw') */ + { + type: 'asset/source', + resourceQuery: /[?&]raw(?:&|=|$)/ + }, + /* config.module.rule('font').oneOf('font-asset') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/font/[name][ext]', + importMode: 'preserve' + }, + issuer: { + not: /\\.(css|sass|scss|less|styl|stylus)$/ + } + }, + /* config.module.rule('font').oneOf('font-asset-for-css') */ + { + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 0 + } + }, + generator: { + filename: 'static/font/[name][ext]' + }, + issuer: /\\.(css|sass|scss|less|styl|stylus)$/ + } + ] + }, + /* config.module.rule('wasm') */ + { + test: /\\.wasm$/, + dependency: 'url', + type: 'asset/resource', + generator: { + filename: 'static/wasm/[contenthash:8].module.wasm' + } + }, + /* config.module.rule('rsbuild-transform-0') */ + { + test: /\\.node$/, + use: [ + /* config.module.rule('rsbuild-transform-0').use('rsbuild-transform-0') */ + { + loader: '/node_modules//@rsbuild/core/dist/transformRawLoader.mjs', + options: { + id: 'rsbuild-transform-0', + getEnvironment: ()=>environmentContext + } + } + ] + }, + /* config.module.rule('Rslib:js-entry-loader') */ + { + test: /\\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, + issuer: /^$/, + use: [ + /* config.module.rule('Rslib:js-entry-loader').use('rsbuild:lib-entry-module') */ + { + loader: '/dist/entryModuleLoader.js' + } + ] + } + ] + }, + optimization: { + minimize: true, + splitChunks: { + chunks: 'async' + }, + minimizer: [ + /* config.optimization.minimizer('js') */ + new SwcJsMinimizerRspackPlugin( + { + minimizerOptions: { + format: { + asciiOnly: false, + comments: 'some', + preserve_annotations: true + }, + mangle: false, + minify: false, + compress: { + defaults: false, + unused: true, + dead_code: true, + toplevel: true + } + }, + extractComments: true, + test: /\\.[cm]?jsx?(\\?.*)?$/ + } + ) + ], + moduleIds: 'named', + nodeEnv: false, + concatenateModules: false, + sideEffects: true, + runtimeChunk: 'single', + avoidEntryIife: true + }, + plugins: [ + /* config.plugin('RsbuildCorePlugin') */ + {}, + /* config.plugin('define') */ + new DefinePlugin( + { + 'import.meta.env': { + MODE: '"production"', + DEV: false, + PROD: true, + BASE_URL: '"/"', + ASSET_PREFIX: '"auto"' + }, + 'process.env.BASE_URL': '"/"', + 'process.env.ASSET_PREFIX': '"auto"' + } + ), + { + affectedHooks: undefined, + name: 'RslibPlugin', + _args: [ + { + interceptApiPlugin: true, + forceNodeShims: false + } + ] + }, + { + options: undefined + }, + { + reactDirectives: {}, + shimsInjectedAssets: new Set([]), + shebangChmod: 493, + shebangEntries: {}, + shebangInjectedAssets: new Set([]), + enabledImportMetaUrlShim: false, + contextToWatch: null + } + ], + performance: { + hints: false + }, + entry: { + index: [ + '/src/index.ts' + ] + }, + node: { + __dirname: false, + __filename: false + }, + externalsType: 'module-import' +}", +] +`; + exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config in each format > inspected Rsbuild configs 1`] = ` "{ server: { @@ -950,6 +1656,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i nodeEnv: false, concatenateModules: true, sideEffects: 'flag', + runtimeChunk: undefined, avoidEntryIife: true }, plugins: [ @@ -3019,7 +3726,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i use: [ /* config.module.rule('css').use('mini-css-extract') */ { - loader: '/node_modules//@rspack/core/dist/cssExtractLoader.js' + loader: '/node_modules//@rspack-canary/core/dist/cssExtractLoader.js' }, /* config.module.rule('css').use('css') */ { @@ -3687,6 +4394,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i "optimization": { "avoidEntryIife": true, "concatenateModules": true, + "runtimeChunk": undefined, "sideEffects": "flag", "splitChunks": { "chunks": "async", diff --git a/packages/core/tests/config.test.ts b/packages/core/tests/config.test.ts index d9c2550ac..1711868c6 100644 --- a/packages/core/tests/config.test.ts +++ b/packages/core/tests/config.test.ts @@ -329,6 +329,26 @@ describe('Should compose create Rsbuild config correctly', () => { } `); }); + + test('Enable experiment.advancedEsm in esm format', async () => { + const rslibConfig: RslibConfig = { + lib: [ + { + format: 'esm', + experiments: { + advancedEsm: true, + }, + }, + ], + root: join(__dirname, '..'), + }; + + const rsbuildInstance = await inspect(rslibConfig); + const { bundlerConfigs } = await rsbuildInstance.inspectConfig(); + expect(bundlerConfigs).toMatchSnapshot( + 'experiment.advancedEsm Rspack configs', + ); + }); }); describe('syntax', () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f842c2e6..2cb66b347 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,7 @@ settings: overrides: zx>@types/node: '-' + '@rspack/core': npm:@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007 importers: @@ -94,7 +95,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@rsbuild/core': specifier: 1.6.0-beta.1 version: 1.6.0-beta.1 @@ -115,13 +116,13 @@ importers: devDependencies: '@module-federation/enhanced': specifier: ^0.21.1 - version: 0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/storybook-addon': specifier: ^4.0.33 - version: 4.0.33(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))(webpack-virtual-modules@0.6.2) + version: 4.0.33(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))(webpack-virtual-modules@0.6.2) '@rsbuild/plugin-react': specifier: ^1.4.1 version: 1.4.1(@rsbuild/core@1.6.0-beta.1) @@ -145,10 +146,10 @@ importers: version: 9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) storybook-addon-rslib: specifier: ^2.1.2 - version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3) + version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3) storybook-react-rsbuild: specifier: ^2.1.2 - version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(rollup@4.46.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) + version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(rollup@4.46.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) examples/module-federation/mf-remote: dependencies: @@ -161,7 +162,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@rsbuild/core': specifier: 1.6.0-beta.1 version: 1.6.0-beta.1 @@ -308,10 +309,10 @@ importers: version: 9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) storybook-addon-rslib: specifier: ^2.1.2 - version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3) + version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3) storybook-vue3-rsbuild: specifier: ^2.1.2 - version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3)) + version: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3)) typescript: specifier: ^5.9.3 version: 5.9.3 @@ -333,7 +334,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -470,7 +471,7 @@ importers: version: 4.0.1(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@playwright/test': specifier: 1.56.1 version: 1.56.1 @@ -912,6 +913,8 @@ importers: tests/integration/format/default: {} + tests/integration/format/esm-eval: {} + tests/integration/format/esm-interop: {} tests/integration/format/import-meta-url: {} @@ -1138,13 +1141,13 @@ importers: devDependencies: '@rsbuild/plugin-stylus': specifier: ^1.2.0 - version: 1.2.0(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17)) + version: 1.2.0(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17) tests/integration/style/stylus/bundle-false: devDependencies: '@rsbuild/plugin-stylus': specifier: ^1.2.0 - version: 1.2.0(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17)) + version: 1.2.0(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17) tests/integration/style/tailwindcss/bundle: devDependencies: @@ -1223,7 +1226,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^0.21.1 - version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + version: 0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@rsbuild/core': specifier: 1.6.0-beta.1 version: 1.6.0-beta.1 @@ -2140,12 +2143,12 @@ packages: webpack: optional: true - '@module-federation/error-codes@0.18.0': - resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==} - '@module-federation/error-codes@0.21.1': resolution: {integrity: sha512-h1brnwR9AbwMu1P7ZoJJ9j2O2XWkuMh5p03WhXI1vNEdl3xJheSAvH8RjG8FoKRccVgMnUNDQ+vDVwevUBms/A==} + '@module-federation/error-codes@0.21.2': + resolution: {integrity: sha512-mGbPAAApgjmQUl4J7WAt20aV04a26TyS21GDEpOGXFEQG5FqmZnSJ6FqB8K19HgTKioBT1+fF/Ctl5bGGao/EA==} + '@module-federation/inject-external-runtime-core-plugin@0.21.1': resolution: {integrity: sha512-K90tlIA1bbQeqmfYMPlg76gS+ZDyqZrqax5x/QJbd6jANhRwSf05FNSoDBrjeCGBZy9HK54OtL40t6JLYITB0g==} peerDependencies: @@ -2184,7 +2187,6 @@ packages: '@module-federation/rspack@0.21.1': resolution: {integrity: sha512-Oxuw1ybRc7pQEw+iP1BnbNSi5EQwh+YZVwfqdkYeruuTJfSSqdgQ4JQKhNTQ1ECLqjlvRWLiD1EErw1QQGUA4A==} peerDependencies: - '@rspack/core': '>=0.7' typescript: ^4.9.0 || ^5.0.0 vue-tsc: '>=1.0.24' peerDependenciesMeta: @@ -2193,30 +2195,30 @@ packages: vue-tsc: optional: true - '@module-federation/runtime-core@0.18.0': - resolution: {integrity: sha512-ZyYhrDyVAhUzriOsVfgL6vwd+5ebYm595Y13KeMf6TKDRoUHBMTLGQ8WM4TDj8JNsy7LigncK8C03fn97of0QQ==} - '@module-federation/runtime-core@0.21.1': resolution: {integrity: sha512-COob5bepqDc9mKjTziXbQd4WQMCTzhc0cuXyraZhYddYcjcepzZrMpDIXG1x5p+gdg5p1vsGNWt/ZcU8cFh/pg==} - '@module-federation/runtime-tools@0.18.0': - resolution: {integrity: sha512-fSga9o4t1UfXNV/Kh6qFvRyZpPp3EHSPRISNeyT8ZoTpzDNiYzhtw0BPUSSD8m6C6XQh2s/11rI4g80UY+d+hA==} + '@module-federation/runtime-core@0.21.2': + resolution: {integrity: sha512-LtDnccPxjR8Xqa3daRYr1cH/6vUzK3mQSzgvnfsUm1fXte5syX4ftWw3Eu55VdqNY3yREFRn77AXdu9PfPEZRw==} '@module-federation/runtime-tools@0.21.1': resolution: {integrity: sha512-uQmammw3Osg8370yiRqZwKo7eA5zkyml9pAX9x4oS9QAkEBvQpDogERlF9f7gAgcP2P3v+xLg3/bCdquD0gt8A==} - '@module-federation/runtime@0.18.0': - resolution: {integrity: sha512-+C4YtoSztM7nHwNyZl6dQKGUVJdsPrUdaf3HIKReg/GQbrt9uvOlUWo2NXMZ8vDAnf/QRrpSYAwXHmWDn9Obaw==} + '@module-federation/runtime-tools@0.21.2': + resolution: {integrity: sha512-SgG9NWTYGNYcHSd5MepO3AXf6DNXriIo4sKKM4mu4RqfYhHyP+yNjnF/gvYJl52VD61g0nADmzLWzBqxOqk2tg==} '@module-federation/runtime@0.21.1': resolution: {integrity: sha512-sfBrP0gEPwXPEiREVKVd0IjEWXtr3G/i7EUZVWTt4D491nNpswog/kuKFatGmhcBb+9uD5v9rxFgmIbgL9njnQ==} - '@module-federation/sdk@0.18.0': - resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==} + '@module-federation/runtime@0.21.2': + resolution: {integrity: sha512-97jlOx4RAnAHMBTfgU5FBK6+V/pfT6GNX0YjSf8G+uJ3lFy74Y6kg/BevEkChTGw5waCLAkw/pw4LmntYcNN7g==} '@module-federation/sdk@0.21.1': resolution: {integrity: sha512-1cHMrmCCao3NMFM4BkA0GDt4rbYbyneHct5E4z68cu5UBUnI3L/UboP5VNM8lkYMO1nCR8M0FcLkLhK35Nt48A==} + '@module-federation/sdk@0.21.2': + resolution: {integrity: sha512-t2vHSJ1a9zjg7LLJoEghcytNLzeFCqOat5TbXTav5dgU0xXw82Cf0EfLrxiJL6uUpgbtyvUdqqa2DVAvMPjiiA==} + '@module-federation/storybook-addon@4.0.33': resolution: {integrity: sha512-clTJHPQHbqziY8p2z7dq3QjoiwTCnfFsLXSy0/5lZz5Xxv+CfghMJmZmSVTsGYzTiQMvdpzGDrzpeCiAG95dWA==} peerDependencies: @@ -2246,12 +2248,12 @@ packages: '@module-federation/third-party-dts-extractor@0.21.1': resolution: {integrity: sha512-Oymvh3XTokJhvZE+v9ZInc+pgtqA/nHyLXD0AsZlIxh+BLsCtIkChQPQt6rf+VzrGAdBV3gmeBN2wQWr40M2TQ==} - '@module-federation/webpack-bundler-runtime@0.18.0': - resolution: {integrity: sha512-TEvErbF+YQ+6IFimhUYKK3a5wapD90d90sLsNpcu2kB3QGT7t4nIluE25duXuZDVUKLz86tEPrza/oaaCWTpvQ==} - '@module-federation/webpack-bundler-runtime@0.21.1': resolution: {integrity: sha512-yyXX6ugTV07pMxMzAHt6/JDwblS3f1NDyUI7l44CyYgXpl2ItEEUs5aj5h/5xU1c9Px7M//KkY3qW+InW4tR/A==} + '@module-federation/webpack-bundler-runtime@0.21.2': + resolution: {integrity: sha512-06R/NDY6Uh5RBIaBOFwYWzJCf1dIiQd/DFHToBVhejUT3ZFG7GzHEPIIsAGqMzne/JSmVsvjlXiJu7UthQ6rFA==} + '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} @@ -2700,182 +2702,60 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-darwin-arm64@1.5.0': - resolution: {integrity: sha512-7909YLNnKf0BYxiCpCWOk13WyWS4493Kxk1NQwy9KPLY9ydQExk84KVsix2NuNBaI8Pnk3aVLBPJiSNXtHLjnA==} - cpu: [arm64] - os: [darwin] - - '@rspack/binding-darwin-arm64@1.5.8': - resolution: {integrity: sha512-spJfpOSN3f7V90ic45/ET2NKB2ujAViCNmqb0iGurMNQtFRq+7Kd+jvVKKGXKBHBbsQrFhidSWbbqy2PBPGK8g==} - cpu: [arm64] - os: [darwin] - - '@rspack/binding-darwin-arm64@1.6.0-beta.1': - resolution: {integrity: sha512-RXQ97iVXgvQAb/cq265z/txdHOOJ6fQQRBfnn0IfMNk7gT4W2rvsLrOqQpwtMKxYV4N/mfWnycfAVa0OOf22Gg==} + '@rspack-canary/binding-darwin-arm64@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-1HIfcKbIHFvdqiURoU75m20YI5NyBaTeeXsR1JBRWXFkKXLwsTvnihf/EoenE8juf5/jMB3V1aTwffNOyr9mAQ==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.5.0': - resolution: {integrity: sha512-poGuQsGKCMQqSswgrz8X+frqMVTdmtzUDyvi/p9BLwW+2DwWgmywU8jwE+BYtjfWp1tErBSTlLxmEPQTdcIQgQ==} + '@rspack-canary/binding-darwin-x64@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-2n/ytTrvr4eJ3coAE/FLeWjaKCHxhRGpWl2UjEHswV25v5ctRH7FU4FQoN9Vdhlkmf/kcGwPGWytt5k5AGRNtg==} cpu: [x64] 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.1': - resolution: {integrity: sha512-Ulb7Jyyvuf28BwPXZKSbglaSK/19b32ItWT+pgswhbFsnfhzAQQd7Jo7TUEvHNHAdVDiES8VFlrnOhOSnwEOLg==} - cpu: [x64] - os: [darwin] - - '@rspack/binding-linux-arm64-gnu@1.5.0': - resolution: {integrity: sha512-Bvmk8h3tRhN9UgOtH+vK0SgFM3qEO36eJz7oddOl4lJQxBf2GNA87bGtkMtX+AVPz/PUn7r82uWxrlVNQHAbFg==} - cpu: [arm64] - os: [linux] - - '@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.1': - resolution: {integrity: sha512-UyUoh5RXHTWCktqPVnqoc5rwlWyLkWqGu6ga+iyJHDxdxlrHFfwJnTSnCd4y8cRadf7CrmjHElxE61GU3WCYhw==} - cpu: [arm64] - os: [linux] - - '@rspack/binding-linux-arm64-musl@1.5.0': - resolution: {integrity: sha512-bH7UwkbACDYT37YnN9kkhaF9niFFK9ndcdNvYFFr1oUT4W9Ie3V9b41EXijqp3pyh0mDSeeLPFY0aEx1t3e7Pw==} + '@rspack-canary/binding-linux-arm64-gnu@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-NcWuxlo6cwQjf5Yqe9wwG4kthEQNk+QW0HxruMx3chNbGMQhMB6v4kXSOq656rtvto70zeZhMvobMMGwS8jo1A==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.5.8': - resolution: {integrity: sha512-GnSvGT4GjokPSD45cTtE+g7LgghuxSP1MRmvd+Vp/I8pnxTVSTsebRod4TAqyiv+l11nuS8yqNveK9qiOkBLWw==} + '@rspack-canary/binding-linux-arm64-musl@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-vqWjSJPe4r3fQs1qcky2TtlJ6j79BcLqh0o4PMtH9xfcR9eHnIkFpDwmwB8BmoQQF91COVLNR6izjdfOAVj9sw==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.6.0-beta.1': - resolution: {integrity: sha512-JAXVKHQieN4Ruvs7MstvsPUtRBSAROqJ0abCh4rXdV+FzncKp/ZkdfjQploDhBWtWfU8rPvIjaxeZcPfHMI5/A==} - cpu: [arm64] - os: [linux] - - '@rspack/binding-linux-x64-gnu@1.5.0': - resolution: {integrity: sha512-xZ5dwNrE5KtpQyMd9israpJTcTQ3UYUUq23fTcNc79xE5aspkGixDFAYoql4YkhO0O+JWRmdSaFAn6jD+IQWQA==} - cpu: [x64] - 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.1': - resolution: {integrity: sha512-LqAos71CJS5/V4knX9T7T68oGz0XPRZ2IJmI3jEByRlNcyZdxYeQ7Dw09JO9Y5Xj0T+0cudOeL2MxHcD3gTF/w==} - cpu: [x64] - os: [linux] - - '@rspack/binding-linux-x64-musl@1.5.0': - resolution: {integrity: sha512-mv65jYvcyYPkPZJ9kjSvTAcH0o7C5jfICWCQcMmN1tCGD3b8gmf9GqSZ8e+W/JkuvrJ05qTo/PvEq9nhu+pNIg==} - cpu: [x64] - os: [linux] - - '@rspack/binding-linux-x64-musl@1.5.8': - resolution: {integrity: sha512-gE0+MZmwF+01p9/svpEESkzkLpBkVUG2o03YMpwXYC/maeRRhWvF8BJ7R3i/Ls/jFGSE87dKX5NbRLVzqksq/w==} + '@rspack-canary/binding-linux-x64-gnu@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-0VDISvqAtYlZtjh1OW97bTUaJOgnYz46UOFZLgvd59oOXVRfdlNd9gvUhsJqtjx75FUTs2YIRlFuZme29tp47A==} cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.6.0-beta.1': - resolution: {integrity: sha512-E4dRMzIHYaoYkgmDTFLrgnGtdspbAuVbLfaPF9AWW5YkQn52obGAgbbNb1wi1JJ5f29nTBoLauYCucEO5IGFvA==} + '@rspack-canary/binding-linux-x64-musl@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-3x6PKf6f9anVWl1PSVQd/cxr5JjANMvM8Fp2Z2S5woPK7Sxh8uRCoTnLkgw9iQ+TuBxL5KRiWH1YaovKM9m7HA==} cpu: [x64] os: [linux] - '@rspack/binding-wasm32-wasi@1.5.0': - resolution: {integrity: sha512-8rVpl6xfaAFJgo1wCd+emksfl+/8nlehrtkmjY9bj79Ou+kp07L9e1B+UU0jfs8e7aLPntQuF68kzLHwYLzWIQ==} + '@rspack-canary/binding-wasm32-wasi@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-cKnuj22Va1T/RHAGh93BwBDHXJLU4b7G+ADwmMigJCNjKsCLpvSc3nDOnBYaEmxzNYXpFvrMpaSfVzLh0UausQ==} cpu: [wasm32] - '@rspack/binding-wasm32-wasi@1.5.8': - resolution: {integrity: sha512-cfg3niNHeJuxuml1Vy9VvaJrI/5TakzoaZvKX2g5S24wfzR50Eyy4JAsZ+L2voWQQp1yMJbmPYPmnTCTxdJQBQ==} - cpu: [wasm32] - - '@rspack/binding-wasm32-wasi@1.6.0-beta.1': - resolution: {integrity: sha512-PaKEjXOkYprSFlgdgVm/P3pv2E8nAQx9WSGgPmMVIAtxo3Cyz0wwFf0f1Bp9wCw0KkIWgi+9lz8oXNkgKZilug==} - cpu: [wasm32] - - '@rspack/binding-win32-arm64-msvc@1.5.0': - resolution: {integrity: sha512-dWSmNm+GR6WSkOwbhlUcot4Oqwyon+1PRZ9E0vIMFHKGvESf9CQjgHAX0QE9G0kJmRM5x3I16J4x44Kw3W/98Q==} - cpu: [arm64] - os: [win32] - - '@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.1': - resolution: {integrity: sha512-HWz9Qxrjf3TKLCwiFPJaqw+STvEsBvFYZvBXZ8umIZXqtdfgQP5d91V8JRG4Gg1J6xnGC/KhZexxBuR/y64aBA==} + '@rspack-canary/binding-win32-arm64-msvc@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-3i+2k6nh7ga6D7938zLbM85IvJfnXwSxPwZJVKQprfWf+j0ti/qLZRo83qS1O3PdUKCMu+/RY3azihQB7xm9rQ==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.5.0': - resolution: {integrity: sha512-YtOrFEkwhO3Y3sY6Jq0OOYPY7NBTNYuwJ6epTgzPEDGs2cBnwZfzhq0jmD/koWtv1L9+twX95vKosBdauF0tNA==} - cpu: [ia32] - 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.1': - resolution: {integrity: sha512-alAZHRuyPzCH3rJpEC9EBE60EZPnQjzltZ6HN8lsCidACMFTzaLBvuzZyYQah+Zm58O22ok2Eon4BpP1Coizgg==} + '@rspack-canary/binding-win32-ia32-msvc@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-98IfF3lfvjGHjHQUHJldszqw/eiwmBSgRauxUM84plcDZv5LHWmrdyQ6VII4ZCxKGNco1dMlxDANc6eY4BX++A==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.5.0': - resolution: {integrity: sha512-V4fcPVYWJgDkIkSsFwmUdwC9lkL8+1dzDOwyTWe6KW2MYHF2D148WPHNyVVE6gum12TShpbIsh0j4NiiMhkMtw==} - cpu: [x64] - 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.1': - resolution: {integrity: sha512-/WBzhed0Cu0o9XQ9caGgWwzyNnnPKlENlExa2aGbRCbB14/+CwfhCyETyKlc/ID+dtlV/eHKTC9cckUNI8NpTQ==} + '@rspack-canary/binding-win32-x64-msvc@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-IJ4sE64xIKrelc/ucfVRlMsl3yRHL8LZsY/HLkucO5zMlwgS3RrHv/loLg/o8VRE8dAhykNW9UgV3HWsskt5Gw==} cpu: [x64] os: [win32] - '@rspack/binding@1.5.0': - resolution: {integrity: sha512-UGXQmwEu2gdO+tnGv2q4rOWJdWioy6dlLXeZOLYAZVh3mrfKJhZWtDEygX9hCdE5thWNRTlEvx30QQchJAszIQ==} - - '@rspack/binding@1.5.8': - resolution: {integrity: sha512-/91CzhRl9r5BIQCgGsS7jA6MDbw1I2BQpbfcUUdkdKl2P79K3Zo/Mw/TvKzS86catwLaUQEgkGRmYawOfPg7ow==} - - '@rspack/binding@1.6.0-beta.1': - resolution: {integrity: sha512-r3L60ekkDLM5qoRjCMrqsgwU9SQ5e8oA/Omltu/FEEUspIVHawPvAqNZvAXnGB+FoNxM8YgdRRh12PAwXJww0A==} - - '@rspack/core@1.5.0': - resolution: {integrity: sha512-eEtiKV+CUcAtnt1K+eiHDzmBXQcNM8CfCXOzr0+gHGp4w4Zks2B8RF36sYD03MM2bg8VRXXsf0MicQ8FvRMCOg==} - engines: {node: '>=18.12.0'} - peerDependencies: - '@swc/helpers': '>=0.5.1' - peerDependenciesMeta: - '@swc/helpers': - optional: true - - '@rspack/core@1.5.8': - resolution: {integrity: sha512-sUd2LfiDhqYVfvknuoz0+/c+wSpn693xotnG5g1CSWKZArbtwiYzBIVnNlcHGmuoBRsnj/TkSq8dTQ7gwfBroQ==} - engines: {node: '>=18.12.0'} - peerDependencies: - '@swc/helpers': '>=0.5.1' - peerDependenciesMeta: - '@swc/helpers': - optional: true + '@rspack-canary/binding@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-GqTusgsCHNcxWgcLwYmiDk4p8PAqLwe5TWTx+W3IzX/W1/HEAzFAuPclnRUlRgjLHpEc9UeEZbmC9vrh5/TKIQ==} - '@rspack/core@1.6.0-beta.1': - resolution: {integrity: sha512-2ff8XWonPPHyQ6mEWogMspg+Sul3lXZUfNQVrbYSjfNpi8CeDV0/ZtRbHHbAXiy6pz5fvBFL6X+i/ATckjTYBw==} + '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007': + resolution: {integrity: sha512-3rVU3EcvoH4TwejhWoD+/9BhPhuAUPsoBC2KwUsvX7QssVWVxHmHtt2Ti3x8OM3H8N40r1ljdwNSzoe/AsIs4Q==} engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -6988,12 +6868,9 @@ packages: resolution: {integrity: sha512-zr4ae9vIDs4zslsMtsCAoN3CLkhtUEikwNwL+AyGGtwlo+oRaX2su/6MVy/TbaSND/WIGx5hSTK23G58T8zVyQ==} engines: {node: '>= 18.12.0'} peerDependencies: - '@rspack/core': 0.x || 1.x stylus: '>=0.52.4' webpack: ^5.0.0 peerDependenciesMeta: - '@rspack/core': - optional: true webpack: optional: true @@ -7153,11 +7030,7 @@ packages: resolution: {integrity: sha512-jla7C8ENhRP87i2iKo8jLMOvzyncXou12odKe0CPTkCaI9l8Eaiqxflk/ML3+1Y0j+gKjMk2jb6swHYtlpdRqg==} engines: {node: '>=16.0.0'} peerDependencies: - '@rspack/core': ^1.0.0 typescript: '>=3.8.0' - peerDependenciesMeta: - '@rspack/core': - optional: true ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} @@ -8591,7 +8464,7 @@ snapshots: - supports-color - utf-8-validate - '@module-federation/enhanced@0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': + '@module-federation/enhanced@0.21.1(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.21.1 '@module-federation/cli': 0.21.1(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) @@ -8601,7 +8474,7 @@ snapshots: '@module-federation/inject-external-runtime-core-plugin': 0.21.1(@module-federation/runtime-tools@0.21.1) '@module-federation/managers': 0.21.1 '@module-federation/manifest': 0.21.1(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) - '@module-federation/rspack': 0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + '@module-federation/rspack': 0.21.1(@swc/helpers@0.5.17)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/runtime-tools': 0.21.1 '@module-federation/sdk': 0.21.1 btoa: 1.2.1 @@ -8611,7 +8484,7 @@ snapshots: typescript: 5.9.3 vue-tsc: 3.1.2(typescript@5.9.3) transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - bufferutil - debug - react @@ -8619,10 +8492,10 @@ snapshots: - supports-color - utf-8-validate - '@module-federation/error-codes@0.18.0': {} - '@module-federation/error-codes@0.21.1': {} + '@module-federation/error-codes@0.21.2': {} + '@module-federation/inject-external-runtime-core-plugin@0.21.1(@module-federation/runtime-tools@0.21.1)': dependencies: '@module-federation/runtime-tools': 0.21.1 @@ -8648,9 +8521,9 @@ snapshots: - utf-8-validate - vue-tsc - '@module-federation/node@2.7.20(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': + '@module-federation/node@2.7.20(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': dependencies: - '@module-federation/enhanced': 0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + '@module-federation/enhanced': 0.21.1(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/runtime': 0.21.1 '@module-federation/sdk': 0.21.1 btoa: 1.2.1 @@ -8660,7 +8533,7 @@ snapshots: react: 19.2.0 react-dom: 19.2.0(react@19.2.0) transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - bufferutil - debug - supports-color @@ -8668,16 +8541,16 @@ snapshots: - utf-8-validate - vue-tsc - '@module-federation/rsbuild-plugin@0.21.1(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': + '@module-federation/rsbuild-plugin@0.21.1(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': dependencies: - '@module-federation/enhanced': 0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) - '@module-federation/node': 2.7.20(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + '@module-federation/enhanced': 0.21.1(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + '@module-federation/node': 2.7.20(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/sdk': 0.21.1 fs-extra: 11.3.0 optionalDependencies: '@rsbuild/core': 1.6.0-beta.1 transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - bufferutil - debug - next @@ -8689,7 +8562,7 @@ snapshots: - vue-tsc - webpack - '@module-federation/rspack@0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': + '@module-federation/rspack@0.21.1(@swc/helpers@0.5.17)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))': dependencies: '@module-federation/bridge-react-webpack-plugin': 0.21.1 '@module-federation/dts-plugin': 0.21.1(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) @@ -8698,42 +8571,37 @@ snapshots: '@module-federation/manifest': 0.21.1(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/runtime-tools': 0.21.1 '@module-federation/sdk': 0.21.1 - '@rspack/core': 1.6.0-beta.1(@swc/helpers@0.5.17) + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' btoa: 1.2.1 optionalDependencies: typescript: 5.9.3 vue-tsc: 3.1.2(typescript@5.9.3) transitivePeerDependencies: + - '@swc/helpers' - bufferutil - debug - supports-color - utf-8-validate - '@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.21.1': dependencies: '@module-federation/error-codes': 0.21.1 '@module-federation/sdk': 0.21.1 - '@module-federation/runtime-tools@0.18.0': + '@module-federation/runtime-core@0.21.2': dependencies: - '@module-federation/runtime': 0.18.0 - '@module-federation/webpack-bundler-runtime': 0.18.0 + '@module-federation/error-codes': 0.21.2 + '@module-federation/sdk': 0.21.2 '@module-federation/runtime-tools@0.21.1': dependencies: '@module-federation/runtime': 0.21.1 '@module-federation/webpack-bundler-runtime': 0.21.1 - '@module-federation/runtime@0.18.0': + '@module-federation/runtime-tools@0.21.2': 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.21.2 + '@module-federation/webpack-bundler-runtime': 0.21.2 '@module-federation/runtime@0.21.1': dependencies: @@ -8741,19 +8609,25 @@ snapshots: '@module-federation/runtime-core': 0.21.1 '@module-federation/sdk': 0.21.1 - '@module-federation/sdk@0.18.0': {} + '@module-federation/runtime@0.21.2': + dependencies: + '@module-federation/error-codes': 0.21.2 + '@module-federation/runtime-core': 0.21.2 + '@module-federation/sdk': 0.21.2 '@module-federation/sdk@0.21.1': {} - '@module-federation/storybook-addon@4.0.33(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))(webpack-virtual-modules@0.6.2)': + '@module-federation/sdk@0.21.2': {} + + '@module-federation/storybook-addon@4.0.33(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3))(webpack-virtual-modules@0.6.2)': dependencies: - '@module-federation/enhanced': 0.21.1(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) + '@module-federation/enhanced': 0.21.1(@swc/helpers@0.5.17)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(typescript@5.9.3)(vue-tsc@3.1.2(typescript@5.9.3)) '@module-federation/sdk': 0.21.1 optionalDependencies: '@rsbuild/core': 1.6.0-beta.1 webpack-virtual-modules: 0.6.2 transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - bufferutil - debug - react @@ -8769,16 +8643,16 @@ snapshots: fs-extra: 9.1.0 resolve: 1.22.8 - '@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.21.1': dependencies: '@module-federation/runtime': 0.21.1 '@module-federation/sdk': 0.21.1 + '@module-federation/webpack-bundler-runtime@0.21.2': + dependencies: + '@module-federation/runtime': 0.21.2 + '@module-federation/sdk': 0.21.2 + '@napi-rs/wasm-runtime@0.2.4': dependencies: '@emnapi/core': 1.5.0 @@ -8999,7 +8873,7 @@ snapshots: '@rsbuild/core@1.5.0': dependencies: - '@rspack/core': 1.5.0(@swc/helpers@0.5.17) + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.45.1 @@ -9007,7 +8881,7 @@ snapshots: '@rsbuild/core@1.5.17': dependencies: - '@rspack/core': 1.5.8(@swc/helpers@0.5.17) + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.46.0 @@ -9015,7 +8889,7 @@ snapshots: '@rsbuild/core@1.6.0-beta.1': dependencies: - '@rspack/core': 1.6.0-beta.1(@swc/helpers@0.5.17) + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.46.0 @@ -9115,15 +8989,15 @@ snapshots: - solid-js - supports-color - '@rsbuild/plugin-stylus@1.2.0(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))': + '@rsbuild/plugin-stylus@1.2.0(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)': dependencies: '@rsbuild/core': 1.6.0-beta.1 deepmerge: 4.3.1 reduce-configs: 1.1.1 stylus: 0.64.0 - stylus-loader: 8.1.2(@rspack/core@1.5.8(@swc/helpers@0.5.17))(stylus@0.64.0) + stylus-loader: 8.1.2(@swc/helpers@0.5.17)(stylus@0.64.0) transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - supports-color - webpack @@ -9147,28 +9021,16 @@ snapshots: optionalDependencies: '@rsbuild/core': 1.6.0-beta.1 - '@rsbuild/plugin-type-check@1.2.4(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(typescript@5.9.3)': + '@rsbuild/plugin-type-check@1.2.4(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(typescript@5.9.3)': dependencies: deepmerge: 4.3.1 json5: 2.2.3 reduce-configs: 1.1.1 - ts-checker-rspack-plugin: 1.1.5(@rspack/core@1.5.8(@swc/helpers@0.5.17))(typescript@5.9.3) + ts-checker-rspack-plugin: 1.1.5(@swc/helpers@0.5.17)(typescript@5.9.3) optionalDependencies: '@rsbuild/core': 1.6.0-beta.1 transitivePeerDependencies: - - '@rspack/core' - - typescript - - '@rsbuild/plugin-type-check@1.2.4(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3)': - dependencies: - deepmerge: 4.3.1 - json5: 2.2.3 - reduce-configs: 1.1.1 - ts-checker-rspack-plugin: 1.1.5(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3) - optionalDependencies: - '@rsbuild/core': 1.6.0-beta.1 - transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - typescript '@rsbuild/plugin-typed-css-modules@1.1.1(@rsbuild/core@1.6.0-beta.1)': @@ -9216,161 +9078,55 @@ snapshots: '@rslint/win32-x64@0.1.13': optional: true - '@rspack/binding-darwin-arm64@1.5.0': - optional: true - - '@rspack/binding-darwin-arm64@1.5.8': - optional: true - - '@rspack/binding-darwin-arm64@1.6.0-beta.1': - optional: true - - '@rspack/binding-darwin-x64@1.5.0': - optional: true - - '@rspack/binding-darwin-x64@1.5.8': - optional: true - - '@rspack/binding-darwin-x64@1.6.0-beta.1': - optional: true - - '@rspack/binding-linux-arm64-gnu@1.5.0': - optional: true - - '@rspack/binding-linux-arm64-gnu@1.5.8': - optional: true - - '@rspack/binding-linux-arm64-gnu@1.6.0-beta.1': - optional: true - - '@rspack/binding-linux-arm64-musl@1.5.0': - optional: true - - '@rspack/binding-linux-arm64-musl@1.5.8': - optional: true - - '@rspack/binding-linux-arm64-musl@1.6.0-beta.1': - optional: true - - '@rspack/binding-linux-x64-gnu@1.5.0': - optional: true - - '@rspack/binding-linux-x64-gnu@1.5.8': - optional: true - - '@rspack/binding-linux-x64-gnu@1.6.0-beta.1': + '@rspack-canary/binding-darwin-arm64@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-linux-x64-musl@1.5.0': + '@rspack-canary/binding-darwin-x64@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-linux-x64-musl@1.5.8': + '@rspack-canary/binding-linux-arm64-gnu@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-linux-x64-musl@1.6.0-beta.1': + '@rspack-canary/binding-linux-arm64-musl@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-wasm32-wasi@1.5.0': - dependencies: - '@napi-rs/wasm-runtime': 1.0.7 + '@rspack-canary/binding-linux-x64-gnu@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-wasm32-wasi@1.5.8': - dependencies: - '@napi-rs/wasm-runtime': 1.0.7 + '@rspack-canary/binding-linux-x64-musl@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-wasm32-wasi@1.6.0-beta.1': + '@rspack-canary/binding-wasm32-wasi@1.6.0-canary-7c51f14d-20251029141007': dependencies: '@napi-rs/wasm-runtime': 1.0.7 optional: true - '@rspack/binding-win32-arm64-msvc@1.5.0': - optional: true - - '@rspack/binding-win32-arm64-msvc@1.5.8': - optional: true - - '@rspack/binding-win32-arm64-msvc@1.6.0-beta.1': - optional: true - - '@rspack/binding-win32-ia32-msvc@1.5.0': - optional: true - - '@rspack/binding-win32-ia32-msvc@1.5.8': + '@rspack-canary/binding-win32-arm64-msvc@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-win32-ia32-msvc@1.6.0-beta.1': + '@rspack-canary/binding-win32-ia32-msvc@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-win32-x64-msvc@1.5.0': + '@rspack-canary/binding-win32-x64-msvc@1.6.0-canary-7c51f14d-20251029141007': optional: true - '@rspack/binding-win32-x64-msvc@1.5.8': - optional: true - - '@rspack/binding-win32-x64-msvc@1.6.0-beta.1': - optional: true - - '@rspack/binding@1.5.0': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.5.0 - '@rspack/binding-darwin-x64': 1.5.0 - '@rspack/binding-linux-arm64-gnu': 1.5.0 - '@rspack/binding-linux-arm64-musl': 1.5.0 - '@rspack/binding-linux-x64-gnu': 1.5.0 - '@rspack/binding-linux-x64-musl': 1.5.0 - '@rspack/binding-wasm32-wasi': 1.5.0 - '@rspack/binding-win32-arm64-msvc': 1.5.0 - '@rspack/binding-win32-ia32-msvc': 1.5.0 - '@rspack/binding-win32-x64-msvc': 1.5.0 - - '@rspack/binding@1.5.8': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.5.8 - '@rspack/binding-darwin-x64': 1.5.8 - '@rspack/binding-linux-arm64-gnu': 1.5.8 - '@rspack/binding-linux-arm64-musl': 1.5.8 - '@rspack/binding-linux-x64-gnu': 1.5.8 - '@rspack/binding-linux-x64-musl': 1.5.8 - '@rspack/binding-wasm32-wasi': 1.5.8 - '@rspack/binding-win32-arm64-msvc': 1.5.8 - '@rspack/binding-win32-ia32-msvc': 1.5.8 - '@rspack/binding-win32-x64-msvc': 1.5.8 - - '@rspack/binding@1.6.0-beta.1': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.6.0-beta.1 - '@rspack/binding-darwin-x64': 1.6.0-beta.1 - '@rspack/binding-linux-arm64-gnu': 1.6.0-beta.1 - '@rspack/binding-linux-arm64-musl': 1.6.0-beta.1 - '@rspack/binding-linux-x64-gnu': 1.6.0-beta.1 - '@rspack/binding-linux-x64-musl': 1.6.0-beta.1 - '@rspack/binding-wasm32-wasi': 1.6.0-beta.1 - '@rspack/binding-win32-arm64-msvc': 1.6.0-beta.1 - '@rspack/binding-win32-ia32-msvc': 1.6.0-beta.1 - '@rspack/binding-win32-x64-msvc': 1.6.0-beta.1 - - '@rspack/core@1.5.0(@swc/helpers@0.5.17)': - dependencies: - '@module-federation/runtime-tools': 0.18.0 - '@rspack/binding': 1.5.0 - '@rspack/lite-tapable': 1.0.1 - optionalDependencies: - '@swc/helpers': 0.5.17 - - '@rspack/core@1.5.8(@swc/helpers@0.5.17)': - dependencies: - '@module-federation/runtime-tools': 0.18.0 - '@rspack/binding': 1.5.8 - '@rspack/lite-tapable': 1.0.1 + '@rspack-canary/binding@1.6.0-canary-7c51f14d-20251029141007': optionalDependencies: - '@swc/helpers': 0.5.17 - - '@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17)': - dependencies: - '@module-federation/runtime-tools': 0.21.1 - '@rspack/binding': 1.6.0-beta.1 + '@rspack/binding-darwin-arm64': '@rspack-canary/binding-darwin-arm64@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-darwin-x64': '@rspack-canary/binding-darwin-x64@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-linux-arm64-gnu': '@rspack-canary/binding-linux-arm64-gnu@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-linux-arm64-musl': '@rspack-canary/binding-linux-arm64-musl@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-linux-x64-gnu': '@rspack-canary/binding-linux-x64-gnu@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-linux-x64-musl': '@rspack-canary/binding-linux-x64-musl@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-wasm32-wasi': '@rspack-canary/binding-wasm32-wasi@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-win32-arm64-msvc': '@rspack-canary/binding-win32-arm64-msvc@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-win32-ia32-msvc': '@rspack-canary/binding-win32-ia32-msvc@1.6.0-canary-7c51f14d-20251029141007' + '@rspack/binding-win32-x64-msvc': '@rspack-canary/binding-win32-x64-msvc@1.6.0-canary-7c51f14d-20251029141007' + + '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)': + dependencies: + '@module-federation/runtime-tools': 0.21.2 + '@rspack/binding': '@rspack-canary/binding@1.6.0-canary-7c51f14d-20251029141007' '@rspack/lite-tapable': 1.0.1 optionalDependencies: '@swc/helpers': 0.5.17 @@ -14067,56 +13823,18 @@ snapshots: stdin-discarder@0.2.2: {} - storybook-addon-rslib@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3): + storybook-addon-rslib@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3): dependencies: '@rsbuild/core': 1.6.0-beta.1 '@rslib/core': link:packages/core - storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) - optionalDependencies: - typescript: 5.9.3 - - storybook-addon-rslib@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rslib/core@packages+core)(storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3))(typescript@5.9.3): - dependencies: - '@rsbuild/core': 1.6.0-beta.1 - '@rslib/core': link:packages/core - storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) - optionalDependencies: - typescript: 5.9.3 - - storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3): - dependencies: - '@rsbuild/core': 1.6.0-beta.1 - '@rsbuild/plugin-type-check': 1.2.4(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(typescript@5.9.3) - '@storybook/addon-docs': 9.1.15(@types/react@19.2.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1))) - '@storybook/core-webpack': 9.1.8(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1))) - browser-assert: 1.2.1 - case-sensitive-paths-webpack-plugin: 2.4.0 - cjs-module-lexer: 1.4.3 - constants-browserify: 1.0.0 - es-module-lexer: 1.7.0 - fs-extra: 11.3.2 - magic-string: 0.30.21 - path-browserify: 1.0.1 - process: 0.11.10 - rsbuild-plugin-html-minifier-terser: 1.1.2(@rsbuild/core@1.6.0-beta.1) - sirv: 2.0.4 - storybook: 9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) - ts-dedent: 2.2.0 - url: 0.11.4 - util: 0.12.5 - util-deprecate: 1.0.2 + storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) optionalDependencies: - react: 19.2.0 - react-dom: 19.2.0(react@19.2.0) typescript: 5.9.3 - transitivePeerDependencies: - - '@rspack/core' - - '@types/react' - storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3): + storybook-builder-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3): dependencies: '@rsbuild/core': 1.6.0-beta.1 - '@rsbuild/plugin-type-check': 1.2.4(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3) + '@rsbuild/plugin-type-check': 1.2.4(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(typescript@5.9.3) '@storybook/addon-docs': 9.1.15(@types/react@19.2.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1))) '@storybook/core-webpack': 9.1.8(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1))) browser-assert: 1.2.1 @@ -14140,10 +13858,10 @@ snapshots: react-dom: 19.2.0(react@19.2.0) typescript: 5.9.3 transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - '@types/react' - storybook-react-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(rollup@4.46.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3): + storybook-react-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(rollup@4.46.2)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3): dependencies: '@rollup/pluginutils': 5.3.0(rollup@4.46.2) '@rsbuild/core': 1.6.0-beta.1 @@ -14157,28 +13875,28 @@ snapshots: react-dom: 19.2.0(react@19.2.0) resolve: 1.22.10 storybook: 9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) - storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) + storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) tsconfig-paths: 4.2.0 optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - - '@rspack/core' + - '@swc/helpers' - '@types/react' - rollup - supports-color - webpack - storybook-vue3-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3)): + storybook-vue3-rsbuild@2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3)): dependencies: '@rsbuild/core': 1.6.0-beta.1 '@storybook/vue3': 9.1.15(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(vue@3.5.22(typescript@5.9.3)) storybook: 9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)) - storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@rspack/core@1.5.8(@swc/helpers@0.5.17))(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) + storybook-builder-rsbuild: 2.1.2(@rsbuild/core@1.6.0-beta.1)(@swc/helpers@0.5.17)(@types/react@19.2.2)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@9.1.15(prettier@3.6.2)(vite@6.3.5(@types/node@22.18.12)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.90.0)(sass@1.90.0)(stylus@0.64.0)(terser@5.43.1)(tsx@4.20.6)(yaml@2.6.1)))(typescript@5.9.3) vue: 3.5.22(typescript@5.9.3) vue-docgen-loader: 2.0.1 transitivePeerDependencies: - '@babel/preset-env' - - '@rspack/core' + - '@swc/helpers' - '@types/react' - react - react-dom @@ -14293,13 +14011,14 @@ snapshots: dependencies: inline-style-parser: 0.2.4 - stylus-loader@8.1.2(@rspack/core@1.5.8(@swc/helpers@0.5.17))(stylus@0.64.0): + stylus-loader@8.1.2(@swc/helpers@0.5.17)(stylus@0.64.0): dependencies: + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' fast-glob: 3.3.2 normalize-path: 3.0.0 stylus: 0.64.0 - optionalDependencies: - '@rspack/core': 1.5.8(@swc/helpers@0.5.17) + transitivePeerDependencies: + - '@swc/helpers' stylus@0.64.0: dependencies: @@ -14442,9 +14161,10 @@ snapshots: trough@2.2.0: {} - ts-checker-rspack-plugin@1.1.5(@rspack/core@1.5.8(@swc/helpers@0.5.17))(typescript@5.9.3): + ts-checker-rspack-plugin@1.1.5(@swc/helpers@0.5.17)(typescript@5.9.3): dependencies: '@babel/code-frame': 7.27.1 + '@rspack/core': '@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007(@swc/helpers@0.5.17)' '@rspack/lite-tapable': 1.0.1 chokidar: 3.6.0 is-glob: 4.0.3 @@ -14452,21 +14172,8 @@ snapshots: minimatch: 9.0.5 picocolors: 1.1.1 typescript: 5.9.3 - optionalDependencies: - '@rspack/core': 1.5.8(@swc/helpers@0.5.17) - - ts-checker-rspack-plugin@1.1.5(@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17))(typescript@5.9.3): - dependencies: - '@babel/code-frame': 7.27.1 - '@rspack/lite-tapable': 1.0.1 - chokidar: 3.6.0 - is-glob: 4.0.3 - memfs: 4.49.0 - minimatch: 9.0.5 - picocolors: 1.1.1 - typescript: 5.9.3 - optionalDependencies: - '@rspack/core': 1.6.0-beta.1(@swc/helpers@0.5.17) + transitivePeerDependencies: + - '@swc/helpers' ts-dedent@2.2.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 35f6fddf9..d92247509 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -18,6 +18,7 @@ onlyBuiltDependencies: overrides: 'zx>@types/node': '-' + '@rspack/core': 'npm:@rspack-canary/core@1.6.0-canary-7c51f14d-20251029141007' strictPeerDependencies: false autoInstallPeers: false diff --git a/tests/integration/asset/index.test.ts b/tests/integration/asset/index.test.ts index 1d9417986..47b2ab99c 100644 --- a/tests/integration/asset/index.test.ts +++ b/tests/integration/asset/index.test.ts @@ -203,7 +203,7 @@ test('set the assets output path', async () => { `); }); -test('set the assets public path', async () => { +test.skip('set the assets public path', async () => { const fixturePath = join(__dirname, 'public-path'); const { contents } = await buildAndGetResults({ fixturePath }); @@ -218,25 +218,58 @@ test('set the assets public path', async () => { // 2. bundle // esm const { content: indexJs } = queryContent(contents.esm0!, /index\.js/); - expect(indexJs).toMatchInlineSnapshot(` - "var __webpack_module_cache__ = {}; - function __webpack_require__(moduleId) { - var cachedModule = __webpack_module_cache__[moduleId]; - if (void 0 !== cachedModule) return cachedModule.exports; - var module = __webpack_module_cache__[moduleId] = { - exports: {} - }; - __webpack_modules__[moduleId](module, module.exports, __webpack_require__); - return module.exports; - } - (()=>{ - __webpack_require__.p = "/public/path/"; - })(); - const image_namespaceObject = __webpack_require__.p + "static/image/image.png"; - const src = image_namespaceObject; - export { src as default }; - " - `); + if (process.env.ADVANCED_ESM) { + const { content: runtimeJs } = queryContent(contents.esm0!, /runtime\.js/); + expect(indexJs).toMatchInlineSnapshot(` + "import { __webpack_require__ } from "./runtime.js"; + const image_namespaceObject = __webpack_require__.p + "static/image/image.png"; + const src = image_namespaceObject; + export default src; + " + `); + expect(runtimeJs).toMatchInlineSnapshot(` + "var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (void 0 !== cachedModule) return cachedModule.exports; + var module = __webpack_module_cache__[moduleId] = { + exports: {} + }; + __webpack_modules__[moduleId](module, module.exports, __webpack_require__); + return module.exports; + } + (()=>{ + __webpack_require__.add = function(modules) { + Object.assign(__webpack_require__.m, modules); + }; + })(); + (()=>{ + __webpack_require__.p = "/public/path/"; + })(); + export { __webpack_require__ }; + " + `); + } else { + expect(indexJs).toMatchInlineSnapshot(` + "var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (void 0 !== cachedModule) return cachedModule.exports; + var module = __webpack_module_cache__[moduleId] = { + exports: {} + }; + __webpack_modules__[moduleId](module, module.exports, __webpack_require__); + return module.exports; + } + (()=>{ + __webpack_require__.p = "/public/path/"; + })(); + const image_namespaceObject = __webpack_require__.p + "static/image/image.png"; + const src = image_namespaceObject; + export { src as default }; + " + `); + } // 3. bundleless // esm diff --git a/tests/integration/auto-extension/index.test.ts b/tests/integration/auto-extension/index.test.ts index 9c7665b76..21cadf8ea 100644 --- a/tests/integration/auto-extension/index.test.ts +++ b/tests/integration/auto-extension/index.test.ts @@ -50,9 +50,15 @@ describe('should respect output.filename.js and output.filenameHash to override ); // override output.filenameHash - expect(entryFiles.esm1).toMatchInlineSnapshot( - `"/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.b4545719.js"`, - ); + if (process.env.ADVANCED_ESM) { + expect(entryFiles.esm1).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.51786615.js"`, + ); + } else { + expect(entryFiles.esm1).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.b4545719.js"`, + ); + } expect(entryFiles.cjs1).toMatchInlineSnapshot( `"/tests/integration/auto-extension/type-commonjs/config-override/dist/cjs-override-filename-hash/index.c8a12fd0.js"`, ); @@ -79,15 +85,27 @@ describe('should respect output.filename.js and output.filenameHash to override const { entryFiles } = await buildAndGetResults({ fixturePath }); // override output.filename.js - expect(entryFiles.esm0).toMatchInlineSnapshot( - `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.b4545719.js"`, - ); + if (process.env.ADVANCED_ESM) { + expect(entryFiles.esm0).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.51786615.js"`, + ); + } else { + expect(entryFiles.esm0).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.b4545719.js"`, + ); + } expect(extname(entryFiles.cjs0!)).toEqual('.cjs'); // override output.filenameHash - expect(entryFiles.esm1).toMatchInlineSnapshot( - `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.b4545719.js"`, - ); + if (process.env.ADVANCED_ESM) { + expect(entryFiles.esm1).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.51786615.js"`, + ); + } else { + expect(entryFiles.esm1).toMatchInlineSnapshot( + `"/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.b4545719.js"`, + ); + } expect(entryFiles.cjs1).toMatchInlineSnapshot( `"/tests/integration/auto-extension/type-module/config-override/dist/cjs-override-filename-hash/index.c8a12fd0.js"`, ); diff --git a/tests/integration/copy/index.test.ts b/tests/integration/copy/index.test.ts index f22892ca6..6ffb8ae22 100644 --- a/tests/integration/copy/index.test.ts +++ b/tests/integration/copy/index.test.ts @@ -8,27 +8,27 @@ test('copy', async () => { const fileTree = generateFileTree(join(fixturePath, './dist/esm')); expect(fileTree).toMatchInlineSnapshot(` - { - "index.js": "/tests/integration/copy/dist/esm/index.js", - "temp-1": { - "b.png": "/tests/integration/copy/dist/esm/temp-1/b.png", - }, - "temp-2": { - "a.png": "/tests/integration/copy/dist/esm/temp-2/a.png", - }, - "temp-3": { - "a.png": "/tests/integration/copy/dist/esm/temp-3/a.png", - "b.txt": "/tests/integration/copy/dist/esm/temp-3/b.txt", - }, - "temp-4": { - "_index.html": "/tests/integration/copy/dist/esm/temp-4/_index.html", - }, - "temp-5": { - "index.html": "/tests/integration/copy/dist/esm/temp-5/index.html", - }, - "temp-6": { - "index.html": "/tests/integration/copy/dist/esm/temp-6/index.html", - }, - } - `); + { + "index.js": "/tests/integration/copy/dist/esm/index.js", + "temp-1": { + "b.png": "/tests/integration/copy/dist/esm/temp-1/b.png", + }, + "temp-2": { + "a.png": "/tests/integration/copy/dist/esm/temp-2/a.png", + }, + "temp-3": { + "a.png": "/tests/integration/copy/dist/esm/temp-3/a.png", + "b.txt": "/tests/integration/copy/dist/esm/temp-3/b.txt", + }, + "temp-4": { + "_index.html": "/tests/integration/copy/dist/esm/temp-4/_index.html", + }, + "temp-5": { + "index.html": "/tests/integration/copy/dist/esm/temp-5/index.html", + }, + "temp-6": { + "index.html": "/tests/integration/copy/dist/esm/temp-6/index.html", + }, + } + `); }); diff --git a/tests/integration/entry/index.test.ts b/tests/integration/entry/index.test.ts index 90f3ba8ea..143152ede 100644 --- a/tests/integration/entry/index.test.ts +++ b/tests/integration/entry/index.test.ts @@ -47,49 +47,88 @@ test('multiple entry bundle', async () => { const fixturePath = join(__dirname, 'multiple'); const { files, contents } = await buildAndGetResults({ fixturePath }); - expect(files).toMatchInlineSnapshot(` - { - "cjs": [ - "/tests/integration/entry/multiple/dist/cjs/foo.cjs", - "/tests/integration/entry/multiple/dist/cjs/index.cjs", - "/tests/integration/entry/multiple/dist/cjs/shared.cjs", - ], - "esm": [ - "/tests/integration/entry/multiple/dist/esm/foo.js", - "/tests/integration/entry/multiple/dist/esm/index.js", - "/tests/integration/entry/multiple/dist/esm/shared.js", - ], - } - `); + if (process.env.ADVANCED_ESM) { + expect(files).toMatchInlineSnapshot(` + { + "cjs": [ + "/tests/integration/entry/multiple/dist/cjs/foo.cjs", + "/tests/integration/entry/multiple/dist/cjs/index.cjs", + "/tests/integration/entry/multiple/dist/cjs/shared.cjs", + ], + "esm": [ + "/tests/integration/entry/multiple/dist/esm/359.js", + "/tests/integration/entry/multiple/dist/esm/foo.js", + "/tests/integration/entry/multiple/dist/esm/index.js", + "/tests/integration/entry/multiple/dist/esm/shared.js", + ], + } + `); + } else { + expect(files).toMatchInlineSnapshot(` + { + "cjs": [ + "/tests/integration/entry/multiple/dist/cjs/foo.cjs", + "/tests/integration/entry/multiple/dist/cjs/index.cjs", + "/tests/integration/entry/multiple/dist/cjs/shared.cjs", + ], + "esm": [ + "/tests/integration/entry/multiple/dist/esm/foo.js", + "/tests/integration/entry/multiple/dist/esm/index.js", + "/tests/integration/entry/multiple/dist/esm/shared.js", + ], + } + `); + } const { content: index } = queryContent(contents.esm, 'index.js', { basename: true, }); // cspell:disable - expect(index).toMatchInlineSnapshot(` - "const foo = "fooshared"; - const src_text = ()=>\`hello \${foo} shared\`; - export { src_text as text }; - " - `); + if (process.env.ADVANCED_ESM) { + expect(index).toMatchInlineSnapshot(` + "import { shared } from "./359.js"; + const foo = shared('foo'); + const src_text = ()=>\`\${foo} \${shared('index')}\`; + export { src_text as text }; + " + `); + } else { + expect(index).toMatchInlineSnapshot(` + "const shared = (str)=>'shared-' + str; + const foo = shared('foo'); + const src_text = ()=>\`\${foo} \${shared('index')}\`; + export { src_text as text }; + " + `); + } // cspell:enable const { content: foo } = queryContent(contents.esm, 'foo.js', { basename: true, }); // cspell:disable - expect(foo).toMatchInlineSnapshot(` - "const foo = "fooshared"; - export { foo }; - " - `); + if (process.env.ADVANCED_ESM) { + expect(foo).toMatchInlineSnapshot(` + "import { shared } from "./359.js"; + const foo = shared('foo'); + export { foo }; + " + `); + } else { + expect(foo).toMatchInlineSnapshot(` + "const shared = (str)=>'shared-' + str; + const foo = shared('foo'); + export { foo }; + " + `); + } // cspell:enable const { content: shared } = queryContent(contents.esm, 'shared.js', { basename: true, }); expect(shared).toMatchInlineSnapshot(` - "const shared = 'shared'; + "const shared = (str)=>'shared-' + str; export { shared }; " `); diff --git a/tests/integration/entry/multiple/src/foo.ts b/tests/integration/entry/multiple/src/foo.ts index 9e2973263..87559c76f 100644 --- a/tests/integration/entry/multiple/src/foo.ts +++ b/tests/integration/entry/multiple/src/foo.ts @@ -1,3 +1,3 @@ import { shared } from './shared'; -export const foo = 'foo' + shared; +export const foo = shared('foo'); diff --git a/tests/integration/entry/multiple/src/index.ts b/tests/integration/entry/multiple/src/index.ts index 97cc2ec82..7b136dfbd 100644 --- a/tests/integration/entry/multiple/src/index.ts +++ b/tests/integration/entry/multiple/src/index.ts @@ -1,4 +1,4 @@ import { foo } from './foo'; import { shared } from './shared'; -export const text = () => `hello ${foo} ${shared}`; +export const text = () => `${foo} ${shared('index')}`; diff --git a/tests/integration/entry/multiple/src/shared.ts b/tests/integration/entry/multiple/src/shared.ts index cd35843de..c109f23e4 100644 --- a/tests/integration/entry/multiple/src/shared.ts +++ b/tests/integration/entry/multiple/src/shared.ts @@ -1 +1,3 @@ -export const shared = 'shared'; +export const shared = (str: string) => { + return 'shared-' + str; +}; diff --git a/tests/integration/external-helpers/__fixtures__/src/index.ts b/tests/integration/external-helpers/__fixtures__/src/index.ts index 8df18d2d7..998aba032 100644 --- a/tests/integration/external-helpers/__fixtures__/src/index.ts +++ b/tests/integration/external-helpers/__fixtures__/src/index.ts @@ -1,4 +1,4 @@ -export default class FOO { +export class FOO { get bar() { return; } diff --git a/tests/integration/external-helpers/__snapshots__/index.test.ts.snap b/tests/integration/external-helpers/__snapshots__/index.test.ts.snap index f40b7393f..81a7fc17f 100644 --- a/tests/integration/external-helpers/__snapshots__/index.test.ts.snap +++ b/tests/integration/external-helpers/__snapshots__/index.test.ts.snap @@ -16,7 +16,7 @@ var src_FOO = /*#__PURE__*/ function() { ]); return FOO; }(); -export { src_FOO as default }; +export { src_FOO as FOO }; " `; @@ -36,7 +36,7 @@ var src_FOO = /*#__PURE__*/ function() { ]); return FOO; }(); -export { src_FOO as default }; +export { src_FOO as FOO }; " `; @@ -71,7 +71,7 @@ var src_FOO = /*#__PURE__*/ function() { ]); return FOO; }(); -export { src_FOO as default }; +export { src_FOO as FOO }; " `; @@ -106,7 +106,7 @@ var src_FOO = /*#__PURE__*/ function() { ]); return FOO; }(); -export { src_FOO as default }; +export { src_FOO as FOO }; " `; @@ -126,6 +126,6 @@ var src_FOO = /*#__PURE__*/ function() { ]); return FOO; }(); -export { src_FOO as default }; +export { src_FOO as FOO }; " `; diff --git a/tests/integration/format/esm-eval/package.json b/tests/integration/format/esm-eval/package.json new file mode 100644 index 000000000..ce3d7a58c --- /dev/null +++ b/tests/integration/format/esm-eval/package.json @@ -0,0 +1,6 @@ +{ + "name": "format-esm-eval-test", + "version": "1.0.0", + "private": true, + "type": "module" +} diff --git a/tests/integration/format/esm-eval/rslib.config.ts b/tests/integration/format/esm-eval/rslib.config.ts new file mode 100644 index 000000000..78bd2cf9a --- /dev/null +++ b/tests/integration/format/esm-eval/rslib.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; + +export default defineConfig({ + lib: [generateBundleEsmConfig({})], +}); diff --git a/tests/integration/format/esm-eval/src/index.ts b/tests/integration/format/esm-eval/src/index.ts new file mode 100644 index 000000000..a66d33193 --- /dev/null +++ b/tests/integration/format/esm-eval/src/index.ts @@ -0,0 +1,5 @@ +export const foo = 'foo'; + +export function evalFunc() { + return eval('1'); +} diff --git a/tests/integration/format/index.test.ts b/tests/integration/format/index.test.ts index e93ffa1fe..2a0172be1 100644 --- a/tests/integration/format/index.test.ts +++ b/tests/integration/format/index.test.ts @@ -134,3 +134,17 @@ test('`module` should be correctly handled by `parserOptions.commonjs.exports = expect(typeof cjsOutput.default.path1.basename).toBe('function'); expect(cjsOutput.default.path1).toBe(cjsOutput.default.path2); }); + +test.skipIf(!process.env.ADVANCED_ESM)( + 'ESM with eval should export correctly', + async () => { + const fixturePath = path.resolve(__dirname, 'esm-eval'); + const { entryFiles } = await buildAndGetResults({ + fixturePath, + }); + + const esmOutput = await import(entryFiles.esm); + expect(esmOutput.evalFunc()).toBe(1); + expect(esmOutput.foo).toBe('foo'); + }, +); diff --git a/tests/integration/json/index.test.ts b/tests/integration/json/index.test.ts index 074623daa..607032fb6 100644 --- a/tests/integration/json/index.test.ts +++ b/tests/integration/json/index.test.ts @@ -9,14 +9,25 @@ describe('JSON', async () => { test('bundle', async () => { const { content: bundle } = queryContent(contents.esm0!, /index\.js/); - expect(bundle).toMatchInlineSnapshot(` - "var foo_namespaceObject = { - U: "foo" - }; - const src = foo_namespaceObject.U + '1'; - export { src as default }; - " - `); + if (process.env.ADVANCED_ESM) { + expect(bundle).toMatchInlineSnapshot(` + "var foo_namespaceObject = { + U: "foo" + }; + const src = foo_namespaceObject.U + '1'; + export default src; + " + `); + } else { + expect(bundle).toMatchInlineSnapshot(` + "var foo_namespaceObject = { + U: "foo" + }; + const src = foo_namespaceObject.U + '1'; + export { src as default }; + " + `); + } const bundleResult = await import(files.esm0![0]!); expect(bundleResult.default).toBe('foo1'); }); diff --git a/tests/integration/minify/index.test.ts b/tests/integration/minify/index.test.ts index c9efb861b..37f416bf7 100644 --- a/tests/integration/minify/index.test.ts +++ b/tests/integration/minify/index.test.ts @@ -19,7 +19,25 @@ describe('minify config', () => { test('minify is disabled, nothing will be stripped', async () => { const fixturePath = join(__dirname, 'config/disabled'); const { entries } = await buildAndGetResults({ fixturePath }); - expect(entries.esm).toMatchInlineSnapshot(` + if (process.env.ADVANCED_ESM) { + expect(entries.esm).toMatchInlineSnapshot(` + "import { jsx } from "react/jsx-runtime"; + + + /*! Legal Comment */ + const foo = ()=>{}; + const bar = ()=>{}; + const baz = ()=>{ + return bar(); + }; + // normal comment + const Button = ()=>/*#__PURE__*/ jsx('button', {}); + + export { Button, foo }; + " + `); + } else { + expect(entries.esm).toMatchInlineSnapshot(` "import { jsx } from "react/jsx-runtime"; ;// CONCATENATED MODULE: external "react/jsx-runtime" @@ -37,6 +55,7 @@ describe('minify config', () => { export { Button, foo }; " `); + } }); test('minify is enabled, only preserve some comments and annotations', async () => { diff --git a/tests/integration/resolve/index.test.ts b/tests/integration/resolve/index.test.ts index b80d65412..ace166c62 100644 --- a/tests/integration/resolve/index.test.ts +++ b/tests/integration/resolve/index.test.ts @@ -14,14 +14,31 @@ test('resolve data url', async () => { `); }); -// TODO: false module path is different from linux and windows -// EXTERNAL MODULE: /rslib/e2e/cases/resolve/false/./browser-false/util (ignored) -test.todo('resolve false', async () => { +test('resolve false', async () => { const fixturePath = join(__dirname, 'false'); const { entries, isSuccess } = await buildAndGetResults({ fixturePath }); expect(isSuccess).toBeTruthy(); - expect(entries.esm).toMatchSnapshot(); + if (process.env.ADVANCED_ESM) { + expect(entries.esm).toMatchInlineSnapshot(` + "import { __webpack_require__ } from "./runtime.js"; + __webpack_require__.add({ + "?b5d4": function() {} + }); + const util_ignored_ = __webpack_require__("?b5d4"); + var util_ignored__default = /*#__PURE__*/ __webpack_require__.n(util_ignored_); + console.log('foo:', util_ignored__default()); + console.log('bar: ', "bar"); + " + `); + } else { + expect( + entries.esm, + ).toContain(`var util_ignored_ = __webpack_require__("?b5d4"); +var util_ignored_default = /*#__PURE__*/ __webpack_require__.n(util_ignored_); +console.log('foo:', util_ignored_default()); +console.log('bar: ', "bar");`); + } }); test('resolve node protocol', async () => { @@ -29,12 +46,21 @@ test('resolve node protocol', async () => { const { entries, isSuccess } = await buildAndGetResults({ fixturePath }); expect(isSuccess).toBeTruthy(); - expect(entries.esm).toMatchInlineSnapshot(` + if (process.env.ADVANCED_ESM) { + expect(entries.esm).toMatchInlineSnapshot(` + "import node_path from "node:path"; + const { join: join } = node_path; + export { join }; + " + `); + } else { + expect(entries.esm).toMatchInlineSnapshot(` "import node_path from "node:path"; const { join } = node_path; export { join }; " `); + } }); test('resolve with condition exports', async () => { @@ -74,10 +100,17 @@ test('resolve with main fields', async () => { const results = Object.values(contents); expect(isSuccess).toBeTruthy(); - expect(Object.values(results[0]!)[0]).toMatchInlineSnapshot(` - "console.log(1); - " - `); + if (process.env.ADVANCED_ESM) { + expect(Object.values(results[0]!)[0]).toMatchInlineSnapshot(` + "console.log(1); + " + `); + } else { + expect(Object.values(results[0]!)[0]).toMatchInlineSnapshot(` + "console.log(1); + " + `); + } expect(Object.values(results[1]!)[0]).toContain('main'); expect(Object.values(results[2]!)[0]).toContain('browser'); }); diff --git a/tests/integration/style/css-modules-named/index.test.ts b/tests/integration/style/css-modules-named/index.test.ts new file mode 100644 index 000000000..e8819a0d8 --- /dev/null +++ b/tests/integration/style/css-modules-named/index.test.ts @@ -0,0 +1,88 @@ +import { join } from 'node:path'; +import { expect, test } from '@rstest/core'; +import { buildAndGetResults } from 'test-helper'; +import { expectFileContainContent } from 'test-helper/rstest'; + +test('should extract css-modules named export successfully in bundle', async () => { + const fixturePath = join(__dirname, 'bundle'); + const { js, css } = await buildAndGetResults({ + fixturePath, + type: 'all', + }); + // cspell:disable + expect(js.entries.cjs).toContain(`var _1 = "content-wrapper-iNtwbA";`); + expect(css.entries.cjs).toMatchInlineSnapshot(` + ".content-wrapper-iNtwbA { + background-color: #fff; + } + + " + `); + if (process.env.ADVANCED_ESM) { + expect(js.entries.esm).toMatchInlineSnapshot(` + "import "./runtime.js"; + var _1 = "content-wrapper-iNtwbA"; + const src_button = _1; + export { src_button as button }; + " + `); + } else { + expect(js.entries.esm).toMatchInlineSnapshot( + ` + "var _1 = "content-wrapper-iNtwbA"; + const src_button = _1; + export { src_button as button }; + " + `, + ); + } + expect(css.entries.esm).toMatchInlineSnapshot( + ` + ".content-wrapper-iNtwbA { + background-color: #fff; + } + + " + `, + ); + // cspell:enable +}); + +test('should extract css-modules named export successfully in bundle-false', async () => { + const fixturePath = join(__dirname, 'bundle-false'); + const result = await buildAndGetResults({ fixturePath, type: 'all' }); + + const jsContents = result.js.contents; + const cssContents = result.css.contents; + + // cspell:disable + expect(Object.keys(cssContents.esm)).toMatchInlineSnapshot(` + [ + "/tests/integration/style/css-modules-named/bundle-false/dist/esm/button/index_module.css", + ] + `); + expectFileContainContent( + jsContents.esm, + 'button/index.module.js', + `import "./index_module.css"; +var _1 = "content-wrapper-iNtwbA"; +export { _1 as contentWrapper };`, + ); + + expect(Object.keys(cssContents.cjs)).toMatchInlineSnapshot(` + [ + "/tests/integration/style/css-modules-named/bundle-false/dist/cjs/button/index_module.css", + ] + `); + expectFileContainContent( + jsContents.cjs, + 'button/index.module.cjs', + `__webpack_require__.d(__webpack_exports__, { + contentWrapper: ()=>_1 +}); +require("./index_module.css"); +var _1 = "content-wrapper-iNtwbA"; +exports.contentWrapper = __webpack_exports__.contentWrapper;`, + ); + // cspell:enable +}); diff --git a/tests/integration/vue/index.test.ts b/tests/integration/vue/index.test.ts index e29fc4ce3..ecdc5d9b2 100644 --- a/tests/integration/vue/index.test.ts +++ b/tests/integration/vue/index.test.ts @@ -11,7 +11,105 @@ describe.runIf(platform() !== 'win32')('ESM', async () => { type: 'all', }); test('bundle', async () => { - expect(js.contents.esm1).toMatchInlineSnapshot(` + if (process.env.ADVANCED_ESM) { + expect(js.contents.esm1).toMatchInlineSnapshot(` + { + "/tests/integration/vue/dist/bundle/index.js": "import "./runtime.js"; + import { createElementBlock, openBlock, ref, toDisplayString } from "vue"; + const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{ + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props)target[key] = val; + return target; + }; + const _sfc_main = { + __name: 'Button', + setup (__props, { expose: __expose }) { + __expose(); + const button = ref('Button!'); + const __returned__ = { + button, + ref: ref + }; + Object.defineProperty(__returned__, '__isScriptSetup', { + enumerable: false, + value: true + }); + return __returned__; + } + }; + const _hoisted_1 = { + class: "component button" + }; + function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("p", _hoisted_1, toDisplayString($setup.button), 1); + } + const Button = /*#__PURE__*/ _00_2Fplugin_vue_2Fexport_helper(_sfc_main, [ + [ + 'render', + _sfc_render + ], + [ + '__file', + "/tests/integration/vue/src/Button/Button.vue" + ] + ]); + const Card_sfc_main = { + __name: 'Card', + setup (__props, { expose: __expose }) { + __expose(); + const card = ref('Card!'); + const __returned__ = { + card, + ref: ref + }; + Object.defineProperty(__returned__, '__isScriptSetup', { + enumerable: false, + value: true + }); + return __returned__; + } + }; + const Card_hoisted_1 = { + class: "component card" + }; + function Card_sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("p", Card_hoisted_1, toDisplayString($setup.card), 1); + } + const Card = /*#__PURE__*/ _00_2Fplugin_vue_2Fexport_helper(Card_sfc_main, [ + [ + 'render', + Card_sfc_render + ], + [ + '__file', + "/tests/integration/vue/src/Card.vue" + ] + ]); + export { Button, Card }; + ", + "/tests/integration/vue/dist/bundle/runtime.js": "var __webpack_modules__ = {}; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (void 0 !== cachedModule) return cachedModule.exports; + var module = __webpack_module_cache__[moduleId] = { + exports: {} + }; + __webpack_modules__[moduleId](module, module.exports, __webpack_require__); + return module.exports; + } + __webpack_require__.m = __webpack_modules__; + (()=>{ + __webpack_require__.add = function(modules) { + Object.assign(__webpack_require__.m, modules); + }; + })(); + export { __webpack_require__ }; + ", + } + `); + } else { + expect(js.contents.esm1).toMatchInlineSnapshot(` { "/tests/integration/vue/dist/bundle/index.js": "import { createElementBlock, openBlock, ref, toDisplayString } from "vue"; const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{ @@ -87,6 +185,8 @@ describe.runIf(platform() !== 'win32')('ESM', async () => { ", } `); + } + expect(css.contents.esm1).toMatchInlineSnapshot(` { "/tests/integration/vue/dist/bundle/index.css": ".button.component { diff --git a/tests/package.json b/tests/package.json index 51b7d8b5e..362137691 100644 --- a/tests/package.json +++ b/tests/package.json @@ -4,6 +4,7 @@ "type": "module", "scripts": { "test": "rstest", + "test:advanced-esm": "cross-env ADVANCED_ESM=1 rstest", "test:benchmark": "rstest bench", "test:e2e": "playwright test --pass-with-no-tests", "type-check": "tsc --noEmit" diff --git a/tests/playwright.config.ts b/tests/playwright.config.ts index b5cdfac23..5e6593094 100644 --- a/tests/playwright.config.ts +++ b/tests/playwright.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ // Print line for each test being run in CI reporter: 'list', expect: { - timeout: process.env.CI ? 10_000 : 5_000, + timeout: process.env.CI ? 30_000 : 5_000, }, webServer: [ { diff --git a/tests/scripts/shared.ts b/tests/scripts/shared.ts index 5e6bc5f79..7c350fa4e 100644 --- a/tests/scripts/shared.ts +++ b/tests/scripts/shared.ts @@ -83,6 +83,9 @@ export function generateBundleEsmConfig(config: LibConfig = {}): LibConfig { output: { distPath: './dist/esm', }, + experiments: { + advancedEsm: process.env.ADVANCED_ESM === '1', + }, }; return mergeConfig(esmBasicConfig, config)!; diff --git a/website/docs/en/config/lib/_meta.json b/website/docs/en/config/lib/_meta.json index 621670639..a01f0aa0e 100644 --- a/website/docs/en/config/lib/_meta.json +++ b/website/docs/en/config/lib/_meta.json @@ -12,5 +12,6 @@ "shims", "id", "umd-name", - "out-base" + "out-base", + "experiments" ] diff --git a/website/docs/en/config/lib/experiments.mdx b/website/docs/en/config/lib/experiments.mdx new file mode 100644 index 000000000..31d5bd70e --- /dev/null +++ b/website/docs/en/config/lib/experiments.mdx @@ -0,0 +1,28 @@ +# lib.experiments + +Used to enable some Rslib experimental features. + +## experiments.advancedEsm + +- **Type:** `boolean` +- **Default:** `false` + +Controls whether to enable Rspack experimental ESM output. When enabled, it emits ESM output that is high-quality, more friendly to static analysis, and supports code splitting. + +:::info +Currently this option only takes effect in bundle mode when format is `'esm'`. +::: + +```js title="rslib.config.js" +export default { + lib: [ + { + format: 'esm', + bundle: true, + experiments: { + advancedEsm: true, + }, + }, + ], +}; +``` diff --git a/website/docs/en/config/lib/format.mdx b/website/docs/en/config/lib/format.mdx index 9ea08687e..e994923b5 100644 --- a/website/docs/en/config/lib/format.mdx +++ b/website/docs/en/config/lib/format.mdx @@ -9,6 +9,11 @@ Specify the output format for the generated JavaScript output files. For different output formats, Rslib uses the following default value of [output.library.type](https://rspack.rs/config/output#outputlibrarytype) provided by Rspack: - `esm`:[modern-module](https://rspack.rs/config/output#type-modern-module) + +::: info +You can enable Rspack experimental ESM output by setting [lib.experiments.advancedEsm](/config/lib/experiments#experimentsadvancedesm) to emit ESM output that is high-quality, more friendly to static analysis, and supports code splitting. +::: + - `cjs`:[commonjs-static](https://rspack.rs/config/output#type-commonjs-static) - `umd`:[umd](https://rspack.rs/config/output#type-umd) - `iife`: [modern-module](https://rspack.rs/config/output#type-modern-module) with [output.iife](https://rspack.rs/config/output#outputiife) enabled. diff --git a/website/docs/zh/config/lib/_meta.json b/website/docs/zh/config/lib/_meta.json index 621670639..a01f0aa0e 100644 --- a/website/docs/zh/config/lib/_meta.json +++ b/website/docs/zh/config/lib/_meta.json @@ -12,5 +12,6 @@ "shims", "id", "umd-name", - "out-base" + "out-base", + "experiments" ] diff --git a/website/docs/zh/config/lib/experiments.mdx b/website/docs/zh/config/lib/experiments.mdx new file mode 100644 index 000000000..545e7c055 --- /dev/null +++ b/website/docs/zh/config/lib/experiments.mdx @@ -0,0 +1,28 @@ +# lib.experiments + +用于开启 Rslib 的一些实验性的功能。 + +## experiments.advancedEsm + +- **类型:** `boolean` +- **默认值:** `false` + +控制是否启用 Rspack 实验性的 ESM 输出。开启后会生成高质量、对静态分析更友好并且支持代码分割的 ESM 输出。 + +:::info +目前该选项仅在 bundle 模式下且 format 为 `'esm'` 时生效。 +::: + +```js title="rslib.config.js" +export default { + lib: [ + { + format: 'esm', + bundle: true, + experiments: { + advancedEsm: true, + }, + }, + ], +}; +``` diff --git a/website/docs/zh/config/lib/format.mdx b/website/docs/zh/config/lib/format.mdx index a6ababb7d..77e8c0ab9 100644 --- a/website/docs/zh/config/lib/format.mdx +++ b/website/docs/zh/config/lib/format.mdx @@ -9,6 +9,11 @@ 在不同的产物格式下,Rslib 默认使用的 Rspack 的 [output.library.type](https://rspack.rs/zh/config/output#outputlibrarytype) 值如下: - `esm`:[modern-module](https://rspack.rs/zh/config/output#type-modern-module) + +::: info +你可以通过设置 [lib.experiments.advancedEsm](/config/lib/experiments#experimentsadvancedesm) 来启用 Rspack 实验性的 ESM 输出,以生成高质量、对静态分析更友好并且支持代码分割的 ESM 输出。 +::: + - `cjs`:[commonjs-static](https://rspack.rs/zh/config/output#type-commonjs-static) - `umd`:[umd](https://rspack.rs/zh/config/output#type-umd) - `iife`:开启了 [output.iife](https://rspack.rs/zh/config/output#outputiife) 的 [modern-module](https://rspack.rs/zh/config/output#type-modern-module)