diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5c267133..197ebcb35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,4 +123,4 @@ The project is still in its early stages and under active development, so it pos | Package | Link | | ------------ | ------------------------------------------------------- | -| @rspack/core | [PR](https://github.com/web-infra-dev/rspack/pull/7210) | +| @rspack/core | [PR](https://github.com/web-infra-dev/rspack/pull/7394) | diff --git a/e2e/cases/alias/__snapshots__/index.test.ts.snap b/e2e/cases/alias/__snapshots__/index.test.ts.snap index 8f21725b5..ec282d3e4 100644 --- a/e2e/cases/alias/__snapshots__/index.test.ts.snap +++ b/e2e/cases/alias/__snapshots__/index.test.ts.snap @@ -9,7 +9,6 @@ const a = 'hello world'; console.info(a); -export { a }; " `; diff --git a/e2e/scripts/shared.ts b/e2e/scripts/shared.ts index cb2535399..bfeb0fb87 100644 --- a/e2e/scripts/shared.ts +++ b/e2e/scripts/shared.ts @@ -1,9 +1,16 @@ import { join } from 'node:path'; -import { mergeRsbuildConfig as mergeConfig } from '@rsbuild/core'; +import { + type InspectConfigResult, + type Rspack, + mergeRsbuildConfig as mergeConfig, +} from '@rsbuild/core'; import type { LibConfig, RslibConfig } from '@rslib/core'; import { globContentJSON } from '#helper'; import { build } from '../../packages/core/src/build'; -import { loadConfig } from '../../packages/core/src/config'; +import { + composeCreateRsbuildConfig, + loadConfig, +} from '../../packages/core/src/config'; export function generateBundleEsmConfig( cwd: string, @@ -103,15 +110,28 @@ export async function getResults( export const buildAndGetResults = async ( fixturePath: string, type: 'js' | 'dts' = 'js', -) => { +): Promise<{ + contents: Record>; + files: Record; + entries: Record; + entryFiles: Record; + rspackConfig: InspectConfigResult['origin']['bundlerConfigs']; + rsbuildConfig: InspectConfigResult['origin']['rsbuildConfig']; +}> => { const rslibConfig = await loadConfig(join(fixturePath, 'rslib.config.ts')); process.chdir(fixturePath); - await build(rslibConfig); + const rsbuildInstance = await build(rslibConfig); + const { + origin: { bundlerConfigs, rsbuildConfig }, + } = await rsbuildInstance.inspectConfig({ verbose: true }); + const results = await getResults(rslibConfig, fixturePath, type); return { contents: results.contents, files: results.files, entries: results.entries, entryFiles: results.entryFiles, + rspackConfig: bundlerConfigs, + rsbuildConfig: rsbuildConfig, }; }; diff --git a/package.json b/package.json index 3a44d109c..0e4229d89 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "pnpm": { "overrides": { - "@rspack/core": "npm:@rspack/core-canary@1.0.0-canary-d77b591-20240718094414" + "@rspack/core": "npm:@rspack/core-canary@1.0.0-canary-338cfbe-20240731183605" } } } diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index b99b640dd..6ac8948d9 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -4,6 +4,7 @@ import { type RsbuildConfig, createRsbuild, defineConfig as defineRsbuildConfig, + loadConfig as loadRsbuildConfig, mergeRsbuildConfig, } from '@rsbuild/core'; import glob from 'fast-glob'; @@ -66,8 +67,7 @@ export async function loadConfig( ): Promise { const root = process.cwd(); const configFilePath = resolveConfigPath(root, customConfig)!; - const { loadConfig } = await import('@rsbuild/core'); - const { content } = await loadConfig({ + const { content } = await loadRsbuildConfig({ cwd: dirname(configFilePath), path: configFilePath, envMode, @@ -107,7 +107,7 @@ export async function createInternalRsbuildConfig(): Promise { }); } -const getDefaultFormatConfig = (format: Format): RsbuildConfig => { +const composeFormatConfig = (format: Format): RsbuildConfig => { switch (format) { case 'esm': return { @@ -163,7 +163,7 @@ const getDefaultFormatConfig = (format: Format): RsbuildConfig => { } }; -const getDefaultAutoExtensionConfig = ( +const composeAutoExtensionConfig = ( format: Format, root: string, autoExtension: boolean, @@ -183,40 +183,69 @@ const getDefaultAutoExtensionConfig = ( }; }; -const getDefaultSyntaxConfig = (syntax?: Syntax): RsbuildConfig => { +const composeSyntaxConfig = ( + syntax?: Syntax, + target?: string, +): RsbuildConfig => { // Defaults to ESNext, Rslib will assume all of the latest JavaScript and CSS features are supported. - return syntax === undefined - ? { - tools: { - rspack: { - // The highest is 2022 in Rspack - target: 'es2022', - }, - swc(config) { - config.jsc ??= {}; - config.jsc.target = 'esnext'; - delete config.env; - return config; - }, - }, - } - : { - output: { - overrideBrowserslist: transformSyntaxToBrowserslist(syntax), + if (syntax) { + return { + tools: { + rspack: (config) => { + // TODO: Rspack should could resolve `browserslist:{query}` like webpack. + // https://webpack.js.org/configuration/target/#browserslist + // Using 'es5' as a temporary solution for compatibility. + config.target = ['es5']; + return config; }, - }; + }, + output: { + overrideBrowserslist: transformSyntaxToBrowserslist(syntax), + }, + }; + } + + // If `syntax` is not defined, Rslib will try to determine by the `target`, with the last version of the target. + const lastTargetVersions = { + node: ['last 1 node versions'], + web: [ + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Edge versions', + 'last 1 Safari versions', + 'last 1 ios_saf versions', + 'not dead', + ], + }; + + return { + tools: { + rspack: (config) => { + config.target = ['es2022']; + return config; + }, + }, + output: { + overrideBrowserslist: + target === 'web' + ? lastTargetVersions.web + : target === 'node' + ? lastTargetVersions.node + : [...lastTargetVersions.node, ...lastTargetVersions.web], + }, + }; }; -const getDefaultEntryConfig = async ( +const composeEntryConfig = async ( entries: NonNullable['entry'], - libConfig: LibConfig, + bundle: LibConfig['bundle'], root: string, ): Promise => { if (!entries) { return {}; } - if (libConfig.bundle !== false) { + if (bundle !== false) { return { source: { entry: entries, @@ -274,7 +303,7 @@ const getDefaultEntryConfig = async ( }; }; -const getBundleConfig = (bundle = true): RsbuildConfig => { +const composeBundleConfig = (bundle = true): RsbuildConfig => { if (bundle) return {}; return { @@ -293,7 +322,7 @@ const getBundleConfig = (bundle = true): RsbuildConfig => { }; }; -const getDefaultDtsConfig = async ( +const composeDtsConfig = async ( libConfig: LibConfig, entryConfig: RsbuildConfig, ): Promise => { @@ -315,62 +344,23 @@ const getDefaultDtsConfig = async ( }; }; -export function convertLibConfigToRsbuildConfig( - libConfig: LibConfig, - configPath: string, -): RsbuildConfig { - const { format, autoExtension = false } = libConfig; - - const formatConfig = getDefaultFormatConfig(format!); - const autoExtensionConfig = getDefaultAutoExtensionConfig( - format!, - dirname(configPath), - autoExtension, - ); - const syntaxConfig = getDefaultSyntaxConfig(libConfig.output?.syntax); - const bundleConfig = getBundleConfig(libConfig.bundle); - - return mergeRsbuildConfig( - formatConfig, - autoExtensionConfig, - syntaxConfig, - bundleConfig, - ); -} - -async function postUpdateRsbuildConfig( - libConfig: LibConfig, - rsbuildConfig: RsbuildConfig, - configPath: string, -) { - const defaultTargetConfig = getDefaultTargetConfig( - rsbuildConfig.output?.target ?? 'web', - ); - - const defaultEntryConfig = await getDefaultEntryConfig( - rsbuildConfig.source?.entry, - libConfig, - dirname(configPath), - ); - - const defaultDtsConfig = await getDefaultDtsConfig( - libConfig, - defaultEntryConfig, - ); - - return mergeRsbuildConfig( - defaultTargetConfig, - defaultEntryConfig, - defaultDtsConfig, - ); -} - -const getDefaultTargetConfig = (target: string): RsbuildConfig => { +const composeTargetConfig = (target = 'web'): RsbuildConfig => { switch (target) { case 'web': - return {}; + return { + tools: { + rspack: { + target: ['web'], + }, + }, + }; case 'node': return { + tools: { + rspack: { + target: ['node'], + }, + }, output: { // When output.target is 'node', Node.js's built-in will be treated as externals of type `node-commonjs`. // Simply override the built-in modules to make them external. @@ -380,16 +370,61 @@ const getDefaultTargetConfig = (target: string): RsbuildConfig => { }, }; case 'neutral': - return {}; + return { + tools: { + rspack: { + target: ['web', 'node'], + }, + }, + }; default: throw new Error(`Unsupported platform: ${target}`); } }; +async function composeLibRsbuildConfig( + libConfig: LibConfig, + rsbuildConfig: RsbuildConfig, + configPath: string, +) { + const config = mergeRsbuildConfig(rsbuildConfig, libConfig); + + const { format, autoExtension = false } = config; + const formatConfig = composeFormatConfig(format!); + const autoExtensionConfig = composeAutoExtensionConfig( + format!, + dirname(configPath), + autoExtension, + ); + const bundleConfig = composeBundleConfig(config.bundle); + const targetConfig = composeTargetConfig(config.output?.target); + const syntaxConfig = composeSyntaxConfig( + config.output?.syntax, + config.output?.target, + ); + const entryConfig = await composeEntryConfig( + config.source?.entry, + config.bundle, + dirname(configPath), + ); + + const dtsConfig = await composeDtsConfig(config, entryConfig); + + return mergeRsbuildConfig( + formatConfig, + autoExtensionConfig, + syntaxConfig, + bundleConfig, + targetConfig, + entryConfig, + dtsConfig, + ); +} + export async function composeCreateRsbuildConfig( rslibConfig: RslibConfig, path?: string, -): Promise>> { +): Promise<{ format: Format; config: RsbuildConfig }[]> { const internalRsbuildConfig = await createInternalRsbuildConfig(); const configPath = path ?? rslibConfig._privateMeta?.configFilePath!; const { lib: libConfigsArray, ...sharedRsbuildConfig } = rslibConfig; @@ -400,53 +435,73 @@ export async function composeCreateRsbuildConfig( ); } - const composedRsbuildConfig: Partial> = {}; - - for (const libConfig of libConfigsArray) { + const libConfigPromises = libConfigsArray.map(async (libConfig) => { const { format, ...overrideRsbuildConfig } = libConfig; - const libConvertedRsbuildConfig = convertLibConfigToRsbuildConfig( - libConfig, - configPath, - ); - - const mergedRsbuildConfig = mergeRsbuildConfig( + const baseRsbuildConfig = mergeRsbuildConfig( sharedRsbuildConfig, overrideRsbuildConfig, - libConvertedRsbuildConfig, ); - // Some configurations can be defined both in the shared config and the lib config. - // So we need to do the post process after lib config is converted and merged. - const postUpdatedConfig = await postUpdateRsbuildConfig( + // Merge the configuration of each environment based on the shared Rsbuild + // configuration and Lib configuration in the settings. + const libRsbuildConfig = await composeLibRsbuildConfig( libConfig, - mergedRsbuildConfig, + baseRsbuildConfig, configPath, ); - // Reset some fields as they will be totally overridden by the following merge - // and we don't want to keep them in the final config. - mergedRsbuildConfig.source ??= {}; - mergedRsbuildConfig.source.entry = {}; - - composedRsbuildConfig[format!] = mergeRsbuildConfig( - mergedRsbuildConfig, - postUpdatedConfig, - // Merge order matters, keep `internalRsbuildConfig` at the last position - // to ensure that the internal config is not overridden by user's config. - internalRsbuildConfig, - ); - } + // Reset certain fields because they will be completely overridden by the upcoming merge. + // We don't want to retain them in the final configuration. + // The reset process should occur after merging the library configuration. + baseRsbuildConfig.source ??= {}; + baseRsbuildConfig.source.entry = {}; + + return { + format: format!, + config: mergeRsbuildConfig( + baseRsbuildConfig, + libRsbuildConfig, + // Merge order matters, keep `internalRsbuildConfig` at the last position + // to ensure that the internal config is not overridden by user's config. + internalRsbuildConfig, + ), + }; + }); + const composedRsbuildConfig = await Promise.all(libConfigPromises); return composedRsbuildConfig; } export async function initRsbuild(rslibConfig: RslibConfig) { const rsbuildConfigObject = await composeCreateRsbuildConfig(rslibConfig); + const environments: RsbuildConfig['environments'] = {}; + const formatCount: Record = rsbuildConfigObject.reduce( + (acc, { format }) => { + acc[format] = (acc[format] ?? 0) + 1; + return acc; + }, + {} as Record, + ); + + const formatIndex: Record = { + esm: 0, + cjs: 0, + umd: 0, + }; + + for (const { format, config } of rsbuildConfigObject) { + const currentFormatCount = formatCount[format]; + const currentFormatIndex = formatIndex[format]++; + + environments[ + currentFormatCount === 1 ? format : `${format}${currentFormatIndex}` + ] = config; + } return createRsbuild({ rsbuildConfig: { - environments: rsbuildConfigObject, + environments, }, }); } diff --git a/packages/core/src/utils/syntax.ts b/packages/core/src/utils/syntax.ts index ad152ad52..88bb069f4 100644 --- a/packages/core/src/utils/syntax.ts +++ b/packages/core/src/utils/syntax.ts @@ -122,7 +122,9 @@ const ESX_TO_BROWSERSLIST: Record< export const transformSyntaxToBrowserslist = ( syntax: Syntax, -): NonNullable['overrideBrowserslist'] => { +): NonNullable< + NonNullable['overrideBrowserslist'] +> => { // only single esX is allowed if (typeof syntax === 'string' && syntax.toLowerCase().startsWith('es')) { if (syntax.toLowerCase() in ESX_TO_BROWSERSLIST) { @@ -132,7 +134,7 @@ export const transformSyntaxToBrowserslist = ( return version; } - return `${engine} ${version}`; + return `${engine} >= ${version}`; }, ); } diff --git a/packages/core/tests/__snapshots__/config.test.ts.snap b/packages/core/tests/__snapshots__/config.test.ts.snap index efd126ee9..5534b8aea 100644 --- a/packages/core/tests/__snapshots__/config.test.ts.snap +++ b/packages/core/tests/__snapshots__/config.test.ts.snap @@ -1,154 +1,218 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1`] = ` -{ - "cjs": { - "dev": { - "progressBar": false, - }, - "output": { - "distPath": { - "js": "./", +[ + { + "config": { + "dev": { + "progressBar": false, }, - "filename": { - "js": "[name].js", + "output": { + "distPath": { + "js": "./", + }, + "filename": { + "js": "[name].js", + }, + "filenameHash": false, + "minify": false, + "overrideBrowserslist": [ + "last 1 node versions", + "last 1 Chrome versions", + "last 1 Firefox versions", + "last 1 Edge versions", + "last 1 Safari versions", + "last 1 ios_saf versions", + "not dead", + ], }, - "filenameHash": false, - "minify": false, - }, - "source": { - "alias": { - "bar": "bar/cjs", - "foo": "foo", + "source": { + "alias": { + "bar": "bar", + "foo": "foo/esm", + }, + "entry": {}, + "preEntry": "./b.js", }, - "entry": {}, - "preEntry": [ - "./a.js", - "./c.js", - "./d.js", - ], - }, - "tools": { - "htmlPlugin": false, - "rspack": { - "experiments": { - "rspackFuture": { - "bundlerInfo": { - "force": false, + "tools": { + "htmlPlugin": false, + "rspack": [ + { + "experiments": { + "outputModule": true, + }, + "externalsType": "module", + "optimization": { + "concatenateModules": true, + }, + "output": { + "chunkFormat": "module", + "library": { + "type": "modern-module", + }, + "module": true, }, }, - }, - "externalsType": "commonjs", - "optimization": { - "moduleIds": "named", - }, - "output": { - "chunkFormat": "commonjs", - "iife": false, - "library": { - "type": "commonjs", + [Function], + { + "target": [ + "web", + ], }, - }, - "target": "es2022", + { + "experiments": { + "rspackFuture": { + "bundlerInfo": { + "force": false, + }, + }, + }, + "optimization": { + "moduleIds": "named", + }, + }, + ], }, - "swc": [Function], }, + "format": "esm", }, - "esm": { - "dev": { - "progressBar": false, - }, - "output": { - "distPath": { - "js": "./", + { + "config": { + "dev": { + "progressBar": false, }, - "filename": { - "js": "[name].js", + "output": { + "distPath": { + "js": "./", + }, + "filename": { + "js": "[name].js", + }, + "filenameHash": false, + "minify": false, + "overrideBrowserslist": [ + "last 1 node versions", + "last 1 Chrome versions", + "last 1 Firefox versions", + "last 1 Edge versions", + "last 1 Safari versions", + "last 1 ios_saf versions", + "not dead", + ], }, - "filenameHash": false, - "minify": false, - }, - "source": { - "alias": { - "bar": "bar", - "foo": "foo/esm", + "source": { + "alias": { + "bar": "bar/cjs", + "foo": "foo", + }, + "entry": {}, + "preEntry": [ + "./a.js", + "./c.js", + "./d.js", + ], }, - "entry": {}, - "preEntry": "./b.js", - }, - "tools": { - "htmlPlugin": false, - "rspack": { - "experiments": { - "outputModule": true, - "rspackFuture": { - "bundlerInfo": { - "force": false, + "tools": { + "htmlPlugin": false, + "rspack": [ + { + "externalsType": "commonjs", + "output": { + "chunkFormat": "commonjs", + "iife": false, + "library": { + "type": "commonjs", + }, }, }, - }, - "externalsType": "module", - "optimization": { - "concatenateModules": true, - "moduleIds": "named", - }, - "output": { - "chunkFormat": "module", - "library": { - "type": "modern-module", + [Function], + { + "target": [ + "web", + ], }, - "module": true, - }, - "target": "es2022", + { + "experiments": { + "rspackFuture": { + "bundlerInfo": { + "force": false, + }, + }, + }, + "optimization": { + "moduleIds": "named", + }, + }, + ], }, - "swc": [Function], }, + "format": "cjs", }, - "umd": { - "dev": { - "progressBar": false, - }, - "output": { - "distPath": { - "js": "./", + { + "config": { + "dev": { + "progressBar": false, }, - "filename": { - "js": "[name].js", + "output": { + "distPath": { + "js": "./", + }, + "filename": { + "js": "[name].js", + }, + "filenameHash": false, + "minify": false, + "overrideBrowserslist": [ + "last 1 node versions", + "last 1 Chrome versions", + "last 1 Firefox versions", + "last 1 Edge versions", + "last 1 Safari versions", + "last 1 ios_saf versions", + "not dead", + ], }, - "filenameHash": false, - "minify": false, - }, - "source": { - "alias": { - "bar": "bar", - "foo": "foo", + "source": { + "alias": { + "bar": "bar", + "foo": "foo", + }, + "entry": {}, + "preEntry": "./a.js", }, - "entry": {}, - "preEntry": "./a.js", - }, - "tools": { - "htmlPlugin": false, - "rspack": { - "experiments": { - "rspackFuture": { - "bundlerInfo": { - "force": false, + "tools": { + "htmlPlugin": false, + "rspack": [ + { + "externalsType": "umd", + "output": { + "library": { + "type": "umd", + }, }, }, - }, - "externalsType": "umd", - "optimization": { - "moduleIds": "named", - }, - "output": { - "library": { - "type": "umd", + [Function], + { + "target": [ + "web", + ], }, - }, - "target": "es2022", + { + "experiments": { + "rspackFuture": { + "bundlerInfo": { + "force": false, + }, + }, + }, + "optimization": { + "moduleIds": "named", + }, + }, + ], }, - "swc": [Function], }, + "format": "umd", }, -} +] `; diff --git a/packages/core/tests/config.test.ts b/packages/core/tests/config.test.ts index 8b8e69c57..d64f8bd3c 100644 --- a/packages/core/tests/config.test.ts +++ b/packages/core/tests/config.test.ts @@ -186,3 +186,123 @@ describe('Should compose create Rsbuild config correctly', () => { expect(composedRsbuildConfig).toMatchSnapshot(); }); }); + +describe('syntax', () => { + test('`syntax` default value', async () => { + const rslibConfig: RslibConfig = { + lib: [ + { + format: 'esm', + }, + ], + }; + + const composedRsbuildConfig = await composeCreateRsbuildConfig( + rslibConfig, + process.cwd(), + ); + + expect( + composedRsbuildConfig[0].config.output?.overrideBrowserslist, + ).toMatchInlineSnapshot(` + [ + "last 1 node versions", + "last 1 Chrome versions", + "last 1 Firefox versions", + "last 1 Edge versions", + "last 1 Safari versions", + "last 1 ios_saf versions", + "not dead", + ] + `); + }); + + test('`syntax` default value should determined by target `web`', async () => { + const rslibConfig: RslibConfig = { + lib: [ + { + format: 'esm', + }, + ], + output: { + target: 'web', + }, + }; + + const composedRsbuildConfig = await composeCreateRsbuildConfig( + rslibConfig, + process.cwd(), + ); + + expect( + composedRsbuildConfig[0].config.output?.overrideBrowserslist, + ).toMatchInlineSnapshot(` + [ + "last 1 Chrome versions", + "last 1 Firefox versions", + "last 1 Edge versions", + "last 1 Safari versions", + "last 1 ios_saf versions", + "not dead", + ] + `); + }); + + test('`syntax` default value should determined by target `node`', async () => { + const rslibConfig: RslibConfig = { + lib: [ + { + format: 'esm', + }, + ], + output: { + target: 'node', + }, + }; + + const composedRsbuildConfig = await composeCreateRsbuildConfig( + rslibConfig, + process.cwd(), + ); + + expect( + composedRsbuildConfig[0].config.output?.overrideBrowserslist, + ).toMatchInlineSnapshot(` + [ + "last 1 node versions", + ] + `); + }); + + test('`syntax` could accept `esX` and transform to browserslist', async () => { + const rslibConfig: RslibConfig = { + lib: [ + { + output: { + syntax: 'es2015', + }, + format: 'esm', + }, + ], + }; + + const composedRsbuildConfig = await composeCreateRsbuildConfig( + rslibConfig, + process.cwd(), + ); + + expect( + composedRsbuildConfig[0].config.output?.overrideBrowserslist, + ).toMatchInlineSnapshot(` + [ + "Chrome >= 63.0.0", + "Edge >= 79.0.0", + "Firefox >= 67.0.0", + "iOS >= 13.0.0", + "Node >= 10.0.0", + "Opera >= 50.0.0", + "Safari >= 13.0.0", + ] + `); + }); +}); diff --git a/packages/core/tests/syntax.test.ts b/packages/core/tests/syntax.test.ts index e33b1a120..9c5326a84 100644 --- a/packages/core/tests/syntax.test.ts +++ b/packages/core/tests/syntax.test.ts @@ -5,28 +5,28 @@ describe('Correctly resolve syntax', () => { test('esX', async () => { expect(transformSyntaxToBrowserslist('es6')).toMatchInlineSnapshot(` [ - "Chrome 63.0.0", - "Edge 79.0.0", - "Firefox 67.0.0", - "iOS 13.0.0", + "Chrome >= 63.0.0", + "Edge >= 79.0.0", + "Firefox >= 67.0.0", + "iOS >= 13.0.0", "node > 12.20.0 and node < 13.0.0", "node > 13.2.0", - "Opera 50.0.0", - "Safari 13.0.0", + "Opera >= 50.0.0", + "Safari >= 13.0.0", ] `); expect(transformSyntaxToBrowserslist('es2018')).toMatchInlineSnapshot(` [ - "Chrome 64.0.0", - "Edge 79.0.0", - "Firefox 78.0.0", - "iOS 16.4.0", + "Chrome >= 64.0.0", + "Edge >= 79.0.0", + "Firefox >= 78.0.0", + "iOS >= 16.4.0", "node > 18.20.0 and node < 19.0.0", "node > 20.12.0 and node < 21.0.0", "node > 21.3.0", - "Opera 51.0.0", - "Safari 16.4.0", + "Opera >= 51.0.0", + "Safari >= 16.4.0", ] `); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c99b682e..d6886cf59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - '@rspack/core': npm:@rspack/core-canary@1.0.0-canary-d77b591-20240718094414 + '@rspack/core': npm:@rspack/core-canary@1.0.0-canary-338cfbe-20240731183605 importers: @@ -1197,56 +1197,56 @@ packages: peerDependencies: '@rsbuild/core': ^1.0.1-beta.9 - '@rspack/binding-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-0DTf4WeXs8mcoZ8maeuD8kZCnPmvZxY8VCED3bL5oMRM8VT9ons8dggn1UFDBaiUoqyD7Ko2OFKb3n1VYHboYw==} + '@rspack/binding-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-lFl8Xt8QcNX0I1Kb/NfJYOa3B8iLBqw9T6CGylWbu0wQQ5TUnspGPfL7MIzi+mZ/eOaEcpIafUlCk+mcd5nC9Q==} - '@rspack/binding-darwin-arm64-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-7Drn6VzjpkBvmeMmV+SjZFN1IxtiNvVGzzLERH3SuRyYT6lv/WthgiOocCtcPQxTbCbBS67NGTglPndWZIOuDg==} + '@rspack/binding-darwin-arm64-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-tO1ps4zfEk+3Sn4vKdn4RNcFqWl5IaNyYXZRHQtQXzJNAEBuSYeL9EDZMngjHQ7ymVfgwKR5Q+Tm0+SfPqO3cA==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-XfBueryD7RHweNJlpXbk0+mswCJFhiey3Cw+RZuO8SJnur+u66ePeH2OF3Atuk8ToKMsXEX81vkcGrZ2LwntIg==} + '@rspack/binding-darwin-x64-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-puZ3ShmJZfj+wanaD6QX0sE3DFYDiSr3tHopLUPtDi2ogPR4EhhFmrHMHhZYcUetAxo9EDCVNolGn3hxIrpwcw==} cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-6f5OSeprOAx0fdyKAdtUnZJvI1NoesPZtcutbuounYr8EBnWU9OcC795iSzLj9lsbsZ6ZcWwaRb45vLcJRd9vw==} + '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-JHh3W3l3dIbOtB8raKANqHn8L60IBTXx5CvjgoWHxqVlHeH8Szp7Uwnzf/7obWUbwONafOB9TBgqsKiRXtEn3w==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-Ajx3GNSOO5eeth9FLY9DMmLEaTiijT5SybTV2nibzb5DLXz41ZjNWCiK2VqlJAf7nodF9QZPsEO/T3V0Ky6Q7Q==} + '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-/hkCF7w2ijmn260uPb49e3aaPjH/QWxymfLPI5nvC4+/Bk1XdYawIiy4A35Bv8kOuZciYYH3TMgkbXblqdamFA==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-nkdF/E3h8H9dKGKmIOkEv+yn8i7gH9E2WRcfsBdNxHAxS+XUEZFc9xNbSsk6auf/1Crznb+umc6hvQ5nQrTUDQ==} + '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-Vpnqu3knK6YTmgvgIEFvEs1DbyVjyghdIrzIdkiJwhRF4AntZe3kxuM+x8fN94iDFHfRhWHTb1OkAooySaEGaw==} cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-Cpezgks1pBD1ZBfi3g2Lz8u3LCYVa/jfnrOxEzs0KXaFskKtehZpJQBFx4m0iOaJRIVL/CEz3P8yhbU0Uzhi4g==} + '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-ALlBgaoRXzYLeBfJLjVF9BpegYDD3wFk7Dtfnk/Ij9kTbzPmhYN5+5FIlTpANBbXfrknp+XqYoPRLsXI1EXtog==} cpu: [x64] os: [linux] - '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-iSHftYqDPMQOoNTN0Rnadi0cYnvJGSGNuHB0rhnRJysFlkwQWdwLnJXHigqwxQQT0a2fSjuUdeXnobf8f0uMwQ==} + '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-ZH1F1zDnjRBPjfO1JzEwa9Wivy8oH81VFQVny0EWhqkzybjldrecAAp51+tsHcEiq8Tuc4c6BhJMfk2QWzQ+BQ==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-edtlZ9NnufE2DKVcQgMpTNTCjp8BDsHgWfN6YsoJjzjHJvtWiubShnp2/1wrwxmbYzCS09w9v6+Sy8apRz6OeA==} + '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-ww0uq30GTb33UpQ5fP07elvfCedlH+CM9BKpNidPci97/mSLcn823/jCBW2yzLauxFbcAdTWabaV5UhvmTfkAQ==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-q8+CKpTbwtXDYnWIsLlMKGjO00pEOHBhbhmOrcO0qKHrVGBP5brb6WA37tYAN330fErsLT0FTppa3LV8Vd0nCQ==} + '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-W2rL0V0S2KL9yUKSy493In/gWBPCcNIn9Ry1xegTbpNMU/++F5T9ZqI/whHets0uQMU9cKWFfQZmsSzCrIXiTg==} cpu: [x64] os: [win32] - '@rspack/core-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-JgmIq1GUdi8e93dQBI1JQFKg3szLBhar1lZCodH3Mqyht+C0wGSRaoy+QegHLkgpx+00qUWLDf3M3eLP4lqntA==} + '@rspack/core-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-gPjYRA29rstYJHkcWmLuIgRq2mCknj22A1E65tg4i/K5yI6nCUxi+nvGVBBvNWKky+5ikGZxWK5O2I0IyH7hsQ==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -1254,8 +1254,8 @@ packages: '@swc/helpers': optional: true - '@rspack/lite-tapable-canary@1.0.0-canary-d77b591-20240718094414': - resolution: {integrity: sha512-rTGAkDCbq7pyVV2BhkYx0xgK65XEhv4VAkZB5HBhbs2HeB2qkP0yT8NZEgkAtMg5R6Q54dndeZGLFboqYtlF5w==} + '@rspack/lite-tapable-canary@1.0.0-canary-338cfbe-20240731183605': + resolution: {integrity: sha512-emikuiIbELsdO28IxMgjkcw8sovk9/BF+L7V3Ix75NLFc2+5MZ8LGteUFrhxfuXr/7eFY1eje858ZmeRPNr4fw==} engines: {node: '>=16.0.0'} '@rspack/lite-tapable@1.0.0-beta.1': @@ -4082,7 +4082,7 @@ snapshots: '@rsbuild/core@1.0.1-beta.8': dependencies: - '@rspack/core': '@rspack/core-canary@1.0.0-canary-d77b591-20240718094414(@swc/helpers@0.5.11)' + '@rspack/core': '@rspack/core-canary@1.0.0-canary-338cfbe-20240731183605(@swc/helpers@0.5.11)' '@rspack/lite-tapable': 1.0.0-beta.1 '@swc/helpers': 0.5.11 caniuse-lite: 1.0.30001643 @@ -4096,55 +4096,55 @@ snapshots: '@rspack/plugin-react-refresh': 1.0.0-beta.1(react-refresh@0.14.2) react-refresh: 0.14.2 - '@rspack/binding-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-canary@1.0.0-canary-338cfbe-20240731183605': optionalDependencies: - '@rspack/binding-darwin-arm64': '@rspack/binding-darwin-arm64-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-darwin-x64': '@rspack/binding-darwin-x64-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-linux-arm64-gnu': '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-linux-arm64-musl': '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-linux-x64-gnu': '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-linux-x64-musl': '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-win32-arm64-msvc': '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-win32-ia32-msvc': '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/binding-win32-x64-msvc': '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-d77b591-20240718094414' - - '@rspack/binding-darwin-arm64-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-darwin-arm64': '@rspack/binding-darwin-arm64-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-darwin-x64': '@rspack/binding-darwin-x64-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-linux-arm64-gnu': '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-linux-arm64-musl': '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-linux-x64-gnu': '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-linux-x64-musl': '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-win32-arm64-msvc': '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-win32-ia32-msvc': '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/binding-win32-x64-msvc': '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-338cfbe-20240731183605' + + '@rspack/binding-darwin-arm64-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-darwin-x64-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-darwin-x64-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-linux-arm64-gnu-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-linux-arm64-musl-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-linux-x64-gnu-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-linux-x64-musl-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-win32-arm64-msvc-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-win32-ia32-msvc-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-d77b591-20240718094414': + '@rspack/binding-win32-x64-msvc-canary@1.0.0-canary-338cfbe-20240731183605': optional: true - '@rspack/core-canary@1.0.0-canary-d77b591-20240718094414(@swc/helpers@0.5.11)': + '@rspack/core-canary@1.0.0-canary-338cfbe-20240731183605(@swc/helpers@0.5.11)': dependencies: '@module-federation/runtime-tools': 0.2.3 - '@rspack/binding': '@rspack/binding-canary@1.0.0-canary-d77b591-20240718094414' - '@rspack/lite-tapable': '@rspack/lite-tapable-canary@1.0.0-canary-d77b591-20240718094414' + '@rspack/binding': '@rspack/binding-canary@1.0.0-canary-338cfbe-20240731183605' + '@rspack/lite-tapable': '@rspack/lite-tapable-canary@1.0.0-canary-338cfbe-20240731183605' caniuse-lite: 1.0.30001643 optionalDependencies: '@swc/helpers': 0.5.11 - '@rspack/lite-tapable-canary@1.0.0-canary-d77b591-20240718094414': {} + '@rspack/lite-tapable-canary@1.0.0-canary-338cfbe-20240731183605': {} '@rspack/lite-tapable@1.0.0-beta.1': {}