diff --git a/.changeset/eleven-pants-hope.md b/.changeset/eleven-pants-hope.md new file mode 100644 index 000000000000..f528c209c5b2 --- /dev/null +++ b/.changeset/eleven-pants-hope.md @@ -0,0 +1,7 @@ +--- +'@modern-js/uni-builder': patch +--- + +fix(uni-builder): apply babel preset-react when using ts-loader + +fix(uni-builder): 使用 ts-loader 时开启 babel preset-react diff --git a/.changeset/kind-apples-joke.md b/.changeset/kind-apples-joke.md new file mode 100644 index 000000000000..fe55f6f20403 --- /dev/null +++ b/.changeset/kind-apples-joke.md @@ -0,0 +1,7 @@ +--- +'@modern-js/prod-server': minor +'@modern-js/server-core': minor +--- + +feat: add server SSR fallback hook +feat: 新增 server SSR 降级 hook 实现 diff --git a/.changeset/ninety-apricots-rhyme.md b/.changeset/ninety-apricots-rhyme.md new file mode 100644 index 000000000000..c606fa7be15c --- /dev/null +++ b/.changeset/ninety-apricots-rhyme.md @@ -0,0 +1,7 @@ +--- +'@modern-js/uni-builder': patch +--- + +fix(uni-builder): repeatedly insert babel plugin when using tsLoader in some edge case + +fix(uni-builder): 修复在一些边界场景下使用 tsLoader 时会重复添加 babel plugin 的问题 diff --git a/packages/builder/builder-webpack-provider/package.json b/packages/builder/builder-webpack-provider/package.json index 77d88dadd274..73a5578fa15e 100644 --- a/packages/builder/builder-webpack-provider/package.json +++ b/packages/builder/builder-webpack-provider/package.json @@ -96,7 +96,7 @@ "@modern-js/types": "workspace:*", "@modern-js/utils": "workspace:*", "@pmmmwh/react-refresh-webpack-plugin": "0.5.10", - "@rsbuild/babel-preset": "0.3.7", + "@rsbuild/babel-preset": "0.4.0", "@swc/helpers": "0.5.3", "babel-plugin-import": "1.13.5", "babel-plugin-styled-components": "1.13.3", diff --git a/packages/builder/builder/package.json b/packages/builder/builder/package.json index 5570befa6c63..04d6460a3987 100644 --- a/packages/builder/builder/package.json +++ b/packages/builder/builder/package.json @@ -62,7 +62,7 @@ "dependencies": { "@modern-js/builder-shared": "workspace:*", "@modern-js/utils": "workspace:*", - "@rsbuild/monorepo-utils": "0.3.7", + "@rsbuild/monorepo-utils": "0.4.0", "@svgr/webpack": "8.1.0", "@swc/helpers": "0.5.3", "deepmerge": "^4.3.1", diff --git a/packages/builder/uni-builder/package.json b/packages/builder/uni-builder/package.json index 3f57ab0a6d6c..fe7dd5c5fd45 100644 --- a/packages/builder/uni-builder/package.json +++ b/packages/builder/uni-builder/package.json @@ -35,23 +35,23 @@ "@modern-js/server": "workspace:*", "@modern-js/prod-server": "workspace:*", "@pmmmwh/react-refresh-webpack-plugin": "0.5.10", - "@rsbuild/babel-preset": "0.3.7", - "@rsbuild/core": "0.3.7", - "@rsbuild/plugin-assets-retry": "0.3.7", - "@rsbuild/plugin-babel": "0.3.7", - "@rsbuild/plugin-check-syntax": "0.3.7", - "@rsbuild/plugin-css-minimizer": "0.3.7", - "@rsbuild/plugin-pug": "0.3.7", - "@rsbuild/plugin-react": "0.3.7", - "@rsbuild/plugin-rem": "0.3.7", - "@rsbuild/plugin-source-build": "0.3.7", - "@rsbuild/plugin-styled-components": "0.3.7", - "@rsbuild/plugin-svgr": "0.3.7", - "@rsbuild/plugin-type-check": "0.3.7", - "@rsbuild/plugin-toml": "0.3.7", - "@rsbuild/plugin-yaml": "0.3.7", - "@rsbuild/shared": "0.3.7", - "@rsbuild/webpack": "0.3.7", + "@rsbuild/babel-preset": "0.4.0", + "@rsbuild/core": "0.4.0", + "@rsbuild/plugin-assets-retry": "0.4.0", + "@rsbuild/plugin-babel": "0.4.0", + "@rsbuild/plugin-check-syntax": "0.4.0", + "@rsbuild/plugin-css-minimizer": "0.4.0", + "@rsbuild/plugin-pug": "0.4.0", + "@rsbuild/plugin-react": "0.4.0", + "@rsbuild/plugin-rem": "0.4.0", + "@rsbuild/plugin-source-build": "0.4.0", + "@rsbuild/plugin-styled-components": "0.4.0", + "@rsbuild/plugin-svgr": "0.4.0", + "@rsbuild/plugin-type-check": "0.4.0", + "@rsbuild/plugin-toml": "0.4.0", + "@rsbuild/plugin-yaml": "0.4.0", + "@rsbuild/shared": "0.4.0", + "@rsbuild/webpack": "0.4.0", "@swc/helpers": "0.5.3", "babel-loader": "9.1.3", "babel-plugin-import": "1.13.5", @@ -62,6 +62,7 @@ "html-webpack-plugin": "5.5.3", "lodash": "^4.17.21", "postcss-custom-properties": "13.1.5", + "postcss-flexbugs-fixes": "5.0.2", "postcss-font-variant": "5.0.0", "postcss-initial": "4.0.1", "postcss-media-minmax": "5.0.0", @@ -76,7 +77,7 @@ }, "devDependencies": { "@modern-js/builder-plugin-node-polyfill": "workspace:*", - "@rsbuild/plugin-swc": "0.3.7", + "@rsbuild/plugin-swc": "0.4.0", "@scripts/build": "workspace:*", "@scripts/vitest-config": "workspace:*", "@types/lodash": "^4.14.202", diff --git a/packages/builder/uni-builder/src/rspack/plugins/babel-post.ts b/packages/builder/uni-builder/src/rspack/plugins/babel-post.ts index fdec8fc98ca2..add98d4f5f54 100644 --- a/packages/builder/uni-builder/src/rspack/plugins/babel-post.ts +++ b/packages/builder/uni-builder/src/rspack/plugins/babel-post.ts @@ -17,10 +17,14 @@ export const pluginBabelPost = (): RsbuildPlugin => ({ .rule(CHAIN_ID.RULE.JS) .use(CHAIN_ID.USE.BABEL) .get('options'); + const config = api.getNormalizedConfig(); if ( babelLoaderOptions && - lodash.isEqual(getDefaultBabelOptions(), babelLoaderOptions) + lodash.isEqual( + getDefaultBabelOptions(config.source.decorators), + babelLoaderOptions, + ) ) { chain.module.rule(CHAIN_ID.RULE.JS).uses.delete(CHAIN_ID.USE.BABEL); } diff --git a/packages/builder/uni-builder/src/shared/parseCommonConfig.ts b/packages/builder/uni-builder/src/shared/parseCommonConfig.ts index 01d7eae2f910..6e187bcbb1fd 100644 --- a/packages/builder/uni-builder/src/shared/parseCommonConfig.ts +++ b/packages/builder/uni-builder/src/shared/parseCommonConfig.ts @@ -33,6 +33,8 @@ import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'; import { pluginPostcssLegacy } from './plugins/postcssLegacy'; import { pluginDevtool } from './plugins/devtools'; import { pluginEmitRouteFile } from './plugins/emitRouteFile'; +import { pluginAntd } from './plugins/antd'; +import { pluginArco } from './plugins/arco'; const GLOBAL_CSS_REGEX = /\.global\.\w+$/; @@ -117,6 +119,8 @@ export async function parseCommonConfig( plugins: [...plugins] = [], performance: { ...performanceConfig } = {}, output: { + disableFilenameHash, + enableLatestDecorators, cssModuleLocalIdentName, enableInlineScripts, disableCssExtract, @@ -167,7 +171,13 @@ export async function parseCommonConfig( security: securityConfig, }; - const { dev = {}, html = {}, output = {} } = rsbuildConfig; + const { dev = {}, html = {}, output = {}, source = {} } = rsbuildConfig; + + if (enableLatestDecorators) { + source.decorators = { + version: '2022-03', + }; + } if (cssModuleLocalIdentName) { output.cssModules ||= {}; @@ -219,6 +229,10 @@ export async function parseCommonConfig( output.inlineStyles = enableInlineStyles; } + if (disableFilenameHash !== undefined) { + output.filenameHash = !disableFilenameHash; + } + const extraConfig: RsbuildConfig = {}; extraConfig.html ||= {}; @@ -330,6 +344,8 @@ export async function parseCommonConfig( pluginEmitRouteFile(), pluginToml(), pluginYaml(), + pluginAntd(), + pluginArco(), ]; if (checkSyntax) { diff --git a/packages/builder/uni-builder/src/shared/plugins/antd.ts b/packages/builder/uni-builder/src/shared/plugins/antd.ts new file mode 100644 index 000000000000..b32bdc5cf8dc --- /dev/null +++ b/packages/builder/uni-builder/src/shared/plugins/antd.ts @@ -0,0 +1,48 @@ +import { isServerTarget, type RsbuildPlugin } from '@rsbuild/shared'; + +const getAntdMajorVersion = (appDirectory: string) => { + try { + const pkgJsonPath = require.resolve('antd/package.json', { + paths: [appDirectory], + }); + const { version } = require(pkgJsonPath); + return Number(version.split('.')[0]); + } catch (err) { + return null; + } +}; + +export const pluginAntd = (): RsbuildPlugin => ({ + name: 'uni-builder:antd', + setup(api) { + api.modifyRsbuildConfig(rsbuildConfig => { + rsbuildConfig.source ??= {}; + + if ( + rsbuildConfig.source.transformImport === false || + rsbuildConfig.source.transformImport?.some( + item => item.libraryName === 'antd', + ) + ) { + return; + } + + const antdMajorVersion = getAntdMajorVersion(api.context.rootPath); + // antd >= v5 no longer need babel-plugin-import + // see: https://ant.design/docs/react/migration-v5#remove-babel-plugin-import + if (antdMajorVersion && antdMajorVersion < 5) { + rsbuildConfig.source ??= {}; + rsbuildConfig.source.transformImport = [ + ...(rsbuildConfig.source.transformImport || []), + { + libraryName: 'antd', + libraryDirectory: isServerTarget(api.context.targets) + ? 'lib' + : 'es', + style: true, + }, + ]; + } + }); + }, +}); diff --git a/packages/builder/uni-builder/src/shared/plugins/arco.ts b/packages/builder/uni-builder/src/shared/plugins/arco.ts new file mode 100644 index 000000000000..4283ffbfcd95 --- /dev/null +++ b/packages/builder/uni-builder/src/shared/plugins/arco.ts @@ -0,0 +1,44 @@ +import { isServerTarget, type RsbuildPlugin } from '@rsbuild/shared'; +import { isPackageInstalled } from '@modern-js/utils'; + +export const pluginArco = (): RsbuildPlugin => ({ + name: 'uni-builder:arco', + + setup(api) { + const ARCO_NAME = '@arco-design/web-react'; + const ARCO_ICON = `${ARCO_NAME}/icon`; + + api.modifyRsbuildConfig(rsbuildConfig => { + const { transformImport = [] } = rsbuildConfig.source || {}; + + if ( + transformImport === false || + !isPackageInstalled(ARCO_NAME, api.context.rootPath) + ) { + return; + } + + const isUseSSR = isServerTarget(api.context.targets); + + if (!transformImport?.some(item => item.libraryName === ARCO_NAME)) { + transformImport.push({ + libraryName: ARCO_NAME, + libraryDirectory: isUseSSR ? 'lib' : 'es', + camelToDashComponentName: false, + style: true, + }); + } + + if (!transformImport?.some(item => item.libraryName === ARCO_ICON)) { + transformImport.push({ + libraryName: ARCO_ICON, + libraryDirectory: isUseSSR ? 'react-icon-cjs' : 'react-icon', + camelToDashComponentName: false, + }); + } + + rsbuildConfig.source ||= {}; + rsbuildConfig.source.transformImport = transformImport; + }); + }, +}); diff --git a/packages/builder/uni-builder/src/shared/plugins/postcssLegacy.ts b/packages/builder/uni-builder/src/shared/plugins/postcssLegacy.ts index 3a985735fccf..011c0f81b894 100644 --- a/packages/builder/uni-builder/src/shared/plugins/postcssLegacy.ts +++ b/packages/builder/uni-builder/src/shared/plugins/postcssLegacy.ts @@ -19,6 +19,7 @@ export const pluginPostcssLegacy = ( const enableCssMinify = !enableExtractCSS && isProd; const plugins = [ + require('postcss-flexbugs-fixes'), !cssSupport.customProperties && require('postcss-custom-properties'), !cssSupport.initial && require('postcss-initial'), !cssSupport.pageBreak && require('postcss-page-break'), diff --git a/packages/builder/uni-builder/src/shared/plugins/splitChunk.ts b/packages/builder/uni-builder/src/shared/plugins/splitChunk.ts index 99ef0b8ba4f3..2e67278f0615 100644 --- a/packages/builder/uni-builder/src/shared/plugins/splitChunk.ts +++ b/packages/builder/uni-builder/src/shared/plugins/splitChunk.ts @@ -1,9 +1,5 @@ -import { - isPlainObject, - isPackageInstalled, - createCacheGroups, - type SplitChunks, -} from '@rsbuild/shared'; +import { createCacheGroups, type SplitChunks } from '@rsbuild/shared'; +import { isPlainObject, isPackageInstalled } from '@modern-js/utils'; import type { RsbuildPlugin } from '@rsbuild/core'; export const pluginSplitChunks = (): RsbuildPlugin => ({ diff --git a/packages/builder/uni-builder/src/types.ts b/packages/builder/uni-builder/src/types.ts index 36a0295bd9ad..e720e2651695 100644 --- a/packages/builder/uni-builder/src/types.ts +++ b/packages/builder/uni-builder/src/types.ts @@ -151,6 +151,14 @@ export type UniBuilderExtraConfig = { resolveExtensionPrefix?: string | Partial>; }; output?: { + /** + * @deprecated use `output.filenameHash` instead + */ + disableFilenameHash?: boolean; + /** + * @deprecated use `source.decorators` instead + */ + enableLatestDecorators?: boolean; /** * @deprecated use `output.cssModules.localIdentName` instead */ diff --git a/packages/builder/uni-builder/src/webpack/plugins/babel.ts b/packages/builder/uni-builder/src/webpack/plugins/babel.ts index c60496bdfebc..2c77cfb20191 100644 --- a/packages/builder/uni-builder/src/webpack/plugins/babel.ts +++ b/packages/builder/uni-builder/src/webpack/plugins/babel.ts @@ -2,7 +2,7 @@ import lodash from 'lodash'; import { getBabelConfigForWeb } from '@rsbuild/babel-preset/web'; import { getBabelConfigForNode } from '@rsbuild/babel-preset/node'; import type { BabelConfig } from '@rsbuild/babel-preset'; -import { isBeyondReact17 } from '@rsbuild/plugin-react'; +import { isBeyondReact17 } from '@modern-js/utils'; import { SCRIPT_REGEX, mergeChainedOptions, @@ -18,11 +18,39 @@ import { type PluginBabelOptions, } from '@rsbuild/plugin-babel'; +/** + * Plugin order: + * rspack mode: rsbuild:swc -> rsbuild:babel + * webpack mode: uni-builder:babel -> uni-builder:ts-loader -> rsbuild-webpack:swc + */ +export const getPresetReact = (rootPath: string, isProd: boolean) => { + const isNewJsx = isBeyondReact17(rootPath); + + const presetReactOptions = { + development: !isProd, + // Will use the native built-in instead of trying to polyfill + useBuiltIns: true, + useSpread: false, + runtime: isNewJsx ? 'automatic' : 'classic', + }; + + return [require.resolve('@babel/preset-react'), presetReactOptions]; +}; + export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({ name: 'uni-builder:babel', + + post: [ + // will replace the babel rule + 'rsbuild-webpack:swc', + // will replace the babel rule + 'rsbuild-webpack:esbuild', + ], + setup(api) { - api.modifyBundlerChain( - async ( + api.modifyBundlerChain({ + order: 'pre', + handler: async ( chain, { CHAIN_ID, target, isProd, isServer, isServiceWorker }, ) => { @@ -32,7 +60,6 @@ export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({ config, target, ); - const isNewJsx = await isBeyondReact17(api.context.rootPath); const getBabelOptions = (config: NormalizedConfig) => { // Create babel util function about include/exclude @@ -56,11 +83,7 @@ export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({ }, }; - const decoratorConfig = { - version: config.output.enableLatestDecorators - ? '2018-09' - : 'legacy', - } as const; + const decoratorConfig = config.source.decorators; const baseBabelConfig = isServer || isServiceWorker @@ -84,18 +107,9 @@ export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({ config.performance.transformLodash, ); - const presetReactOptions = { - development: !isProd, - // Will use the native built-in instead of trying to polyfill - useBuiltIns: true, - useSpread: false, - runtime: isNewJsx ? 'automatic' : 'classic', - }; - - baseBabelConfig.presets?.push([ - require.resolve('@babel/preset-react'), - presetReactOptions, - ]); + baseBabelConfig.presets?.push( + getPresetReact(api.context.rootPath, isProd), + ); if (isProd) { baseBabelConfig.plugins?.push([ @@ -162,12 +176,16 @@ export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({ .mimetype({ or: ['text/javascript', 'application/javascript'], }) + // compatible with legacy packages with type="module" + // https://github.com/webpack/webpack/issues/11467 + .resolve.set('fullySpecified', false) + .end() .use(CHAIN_ID.USE.BABEL) .loader(require.resolve('babel-loader')) // Using cloned options to keep options separate from each other .options(lodash.cloneDeep(babelOptions)); }, - ); + }); }, }); diff --git a/packages/builder/uni-builder/src/webpack/plugins/tsLoader.ts b/packages/builder/uni-builder/src/webpack/plugins/tsLoader.ts index a29d4aa5fcb9..69cd9bbf92c2 100644 --- a/packages/builder/uni-builder/src/webpack/plugins/tsLoader.ts +++ b/packages/builder/uni-builder/src/webpack/plugins/tsLoader.ts @@ -16,6 +16,7 @@ import { import { getBabelConfigForWeb } from '@rsbuild/babel-preset/web'; import type { RsbuildPlugin } from '@rsbuild/core'; import type { Options as RawTSLoaderOptions } from 'ts-loader'; +import { getPresetReact } from './babel'; export type TSLoaderOptions = Partial; @@ -44,81 +45,91 @@ export const pluginTsLoader = ( pre: ['uni-builder:babel'], - post: ['uni-builder:react'], - setup(api) { - api.modifyBundlerChain(async (chain, { target, CHAIN_ID }) => { - const config = api.getNormalizedConfig(); - const { rootPath } = api.context; - const browserslist = await getBrowserslistWithDefault( - rootPath, - config, - target, - ); + api.modifyBundlerChain({ + order: 'pre', + handler: async (chain, { isProd, target, CHAIN_ID }) => { + const config = api.getNormalizedConfig(); + const { rootPath } = api.context; + const browserslist = await getBrowserslistWithDefault( + rootPath, + config, + target, + ); + + const baseBabelConfig = getBabelConfigForWeb({ + presetEnv: { + targets: browserslist, + useBuiltIns: getUseBuiltIns(config), + }, + }); - const baseBabelConfig = getBabelConfigForWeb({ - presetEnv: { - targets: browserslist, - useBuiltIns: getUseBuiltIns(config), - }, - }); + baseBabelConfig.presets?.push( + getPresetReact(api.context.rootPath, isProd), + ); - const babelUtils = getBabelUtils(baseBabelConfig); + const babelUtils = getBabelUtils(baseBabelConfig); - const babelLoaderOptions = mergeChainedOptions({ - defaults: baseBabelConfig, - options: babelOptions, - utils: babelUtils, - }); + const babelLoaderOptions = mergeChainedOptions({ + defaults: baseBabelConfig, + options: babelOptions, + utils: babelUtils, + }); - const includes: Array = []; - const excludes: Array = []; + const includes: Array = []; + const excludes: Array = []; - const tsLoaderUtils = { - addIncludes(items: string | RegExp | (string | RegExp)[]) { - includes.push(...castArray(items)); - }, - addExcludes(items: string | RegExp | (string | RegExp)[]) { - excludes.push(...castArray(items)); - }, - }; - const tsLoaderDefaultOptions = { - compilerOptions: { - target: 'esnext', - module: 'esnext', - }, - transpileOnly: true, - allowTsInNodeModules: true, - }; + const tsLoaderUtils = { + addIncludes(items: string | RegExp | (string | RegExp)[]) { + includes.push(...castArray(items)); + }, + addExcludes(items: string | RegExp | (string | RegExp)[]) { + excludes.push(...castArray(items)); + }, + }; + const tsLoaderDefaultOptions = { + compilerOptions: { + target: 'esnext', + module: 'esnext', + }, + transpileOnly: true, + allowTsInNodeModules: true, + }; - const tsLoaderOptions = mergeChainedOptions({ - defaults: tsLoaderDefaultOptions, - // @ts-expect-error ts-loader has incorrect types for compilerOptions - options, - utils: tsLoaderUtils, - }); - const rule = chain.module.rule(CHAIN_ID.RULE.TS); + const tsLoaderOptions = mergeChainedOptions({ + defaults: tsLoaderDefaultOptions, + // @ts-expect-error ts-loader has incorrect types for compilerOptions + options, + utils: tsLoaderUtils, + }); + const rule = chain.module.rule(CHAIN_ID.RULE.TS); - applyScriptCondition({ - rule, - config, - context: api.context, - includes, - excludes, - }); + applyScriptCondition({ + rule, + config, + context: api.context, + includes, + excludes, + }); - // adjust babel rule to only handle JS files - chain.module.rule(CHAIN_ID.RULE.JS).test(JS_REGEX); + // adjust babel rule to only handle JS files + chain.module.rule(CHAIN_ID.RULE.JS).test(JS_REGEX); - rule - .test(TS_REGEX) - .use(CHAIN_ID.USE.BABEL) - .loader(require.resolve('babel-loader')) - .options(babelLoaderOptions) - .end() - .use(CHAIN_ID.USE.TS) - .loader(require.resolve('ts-loader')) - .options(tsLoaderOptions); + rule + .test(TS_REGEX) + .use(CHAIN_ID.USE.BABEL) + .loader(require.resolve('babel-loader')) + .options({ + ...babelLoaderOptions, + // fix repeatedly insert babel plugin in some boundary cases + plugins: [...(babelLoaderOptions.plugins || [])], + presets: [...(babelLoaderOptions.presets || [])], + }) + .end() + .use(CHAIN_ID.USE.TS) + .loader(require.resolve('ts-loader')) + .options(tsLoaderOptions); + }, }); }, }; diff --git a/packages/builder/uni-builder/tests/__snapshots__/babel.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/babel.test.ts.snap index 20eb1bfa8d31..4c22d662eb9c 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/babel.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/babel.test.ts.snap @@ -48,7 +48,7 @@ exports[`plugin-babel (rspack mode) > should not set babel-loader when babel con "decoratorMetadata": true, "legacyDecorator": true, "react": { - "development": true, + "development": false, "refresh": true, "runtime": "automatic", }, @@ -136,7 +136,7 @@ exports[`plugin-babel (rspack mode) > should set babel-loader when babel config "decoratorMetadata": true, "legacyDecorator": true, "react": { - "development": true, + "development": false, "refresh": true, "runtime": "automatic", }, @@ -178,6 +178,12 @@ exports[`plugin-babel (rspack mode) > should set babel-loader when babel config "compact": false, "configFile": false, "plugins": [ + [ + "/node_modules//@babel/plugin-proposal-decorators/lib/index.js", + { + "version": "legacy", + }, + ], [ "babel-plugin-import", { @@ -340,7 +346,7 @@ exports[`plugin-babel > should add core-js-entry when output.polyfill is entry 1 "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -466,7 +472,7 @@ exports[`plugin-babel > should adjust browserslist when target is node 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -616,7 +622,7 @@ exports[`plugin-babel > should apply exclude condition when using source.exclude "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -763,7 +769,7 @@ exports[`plugin-babel > should not add core-js-entry when output.polyfill is usa "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -876,7 +882,7 @@ exports[`plugin-babel > should not have any pluginImport in Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -893,6 +899,9 @@ exports[`plugin-babel > should not have any pluginImport in Babel 1`] = ` "application/javascript", ], }, + "resolve": { + "fullySpecified": false, + }, "use": [ { "loader": "/node_modules//babel-loader/lib/index.js", @@ -972,7 +981,7 @@ exports[`plugin-babel > should not have any pluginImport in Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1113,7 +1122,7 @@ exports[`plugin-babel > should not set default pluginImport for Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1130,6 +1139,9 @@ exports[`plugin-babel > should not set default pluginImport for Babel 1`] = ` "application/javascript", ], }, + "resolve": { + "fullySpecified": false, + }, "use": [ { "loader": "/node_modules//babel-loader/lib/index.js", @@ -1237,7 +1249,7 @@ exports[`plugin-babel > should not set default pluginImport for Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1382,7 +1394,7 @@ exports[`plugin-babel > should override targets of babel-preset-env when using o "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1529,7 +1541,7 @@ exports[`plugin-babel > should set babel-loader 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1680,7 +1692,7 @@ exports[`plugin-babel > should set include/exclude 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1829,7 +1841,7 @@ exports[`plugin-babel > should set proper pluginImport option in Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -1846,6 +1858,9 @@ exports[`plugin-babel > should set proper pluginImport option in Babel 1`] = ` "application/javascript", ], }, + "resolve": { + "fullySpecified": false, + }, "use": [ { "loader": "/node_modules//babel-loader/lib/index.js", @@ -1961,7 +1976,7 @@ exports[`plugin-babel > should set proper pluginImport option in Babel 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, diff --git a/packages/builder/uni-builder/tests/__snapshots__/default.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/default.test.ts.snap index 0b45d541f578..9486c7b45940 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/default.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/default.test.ts.snap @@ -39,6 +39,156 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` }, "test": /\\\\\\.m\\?js/, }, + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": true, + "refresh": true, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": false, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": true, + }, + }, + ], + }, + { + "mimetype": { + "or": [ + "text/javascript", + "application/javascript", + ], + }, + "resolve": { + "fullySpecified": false, + }, + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": true, + "refresh": true, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": false, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": true, + }, + }, + ], + }, { "oneOf": [ { @@ -144,7 +294,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -169,6 +318,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -189,7 +339,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -214,6 +363,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -240,7 +390,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -265,6 +414,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -276,6 +426,9 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": true, }, @@ -295,7 +448,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -320,6 +472,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -331,6 +484,9 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": true, }, @@ -356,7 +512,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -381,6 +536,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -415,7 +571,6 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -440,6 +595,7 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` [Function], [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -465,172 +621,25 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = ` "test": /\\\\\\.s\\(\\?:a\\|c\\)ss\\$/, }, { - "include": [ + "test": /\\\\\\.toml\\$/, + "type": "javascript/auto", + "use": [ { - "and": [ - "", - { - "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, - }, - ], + "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", }, - /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, ], - "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, + }, + { + "test": /\\\\\\.ya\\?ml\\$/, "type": "javascript/auto", "use": [ { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": true, - "refresh": true, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": false, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": true, - }, + "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", }, ], }, { - "mimetype": { - "or": [ - "text/javascript", - "application/javascript", - ], - }, - "use": [ - { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": true, - "refresh": true, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": false, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": true, - }, - }, - ], - }, - { - "test": /\\\\\\.toml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", - }, - ], - }, - { - "test": /\\\\\\.ya\\?ml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", - }, - ], - }, - { - "oneOf": [ + "oneOf": [ { "generator": { "filename": "static/svg/[name].[contenthash:8].svg", @@ -981,10 +990,12 @@ exports[`uni-builder rspack > should generator rspack config correctly 2`] = ` "rsbuild:start-url", "rsbuild:inline-chunk", "rsbuild:bundle-analyzer", + "rsbuild:rsdoctor", "plugin-network-performance", "plugin-preload-or-prefetch", "rsbuild:performance", "rsbuild:server", + "rsbuild:module-federation", "rsbuild:rspack-profile", "uni-builder:split-chunks", "uni-builder:global-vars", @@ -992,6 +1003,8 @@ exports[`uni-builder rspack > should generator rspack config correctly 2`] = ` "uni-builder:emit-route-file", "rsbuild:toml", "rsbuild:yaml", + "uni-builder:antd", + "uni-builder:arco", "rsbuild:type-check", "uni-builder:runtime-chunk", "rsbuild:react", @@ -1041,6 +1054,156 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod }, "test": /\\\\\\.m\\?js/, }, + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": false, + "refresh": false, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": true, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": false, + }, + }, + ], + }, + { + "mimetype": { + "or": [ + "text/javascript", + "application/javascript", + ], + }, + "resolve": { + "fullySpecified": false, + }, + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": false, + "refresh": false, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": true, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": false, + }, + }, + ], + }, { "oneOf": [ { @@ -1146,7 +1309,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1171,6 +1333,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1191,7 +1354,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1216,6 +1378,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1242,7 +1405,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1267,6 +1429,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1278,6 +1441,9 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": false, }, @@ -1297,7 +1463,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1322,6 +1487,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1333,6 +1499,9 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": false, }, @@ -1358,7 +1527,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1383,6 +1551,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1417,7 +1586,6 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -1442,6 +1610,7 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -1467,163 +1636,16 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod "test": /\\\\\\.s\\(\\?:a\\|c\\)ss\\$/, }, { - "include": [ + "test": /\\\\\\.toml\\$/, + "type": "javascript/auto", + "use": [ { - "and": [ - "", - { - "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, - }, - ], + "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", }, - /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, ], - "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": false, - "refresh": false, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": true, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": false, - }, - }, - ], - }, - { - "mimetype": { - "or": [ - "text/javascript", - "application/javascript", - ], - }, - "use": [ - { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": false, - "refresh": false, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": true, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": false, - }, - }, - ], - }, - { - "test": /\\\\\\.toml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", - }, - ], - }, - { - "test": /\\\\\\.ya\\?ml\\$/, + }, + { + "test": /\\\\\\.ya\\?ml\\$/, "type": "javascript/auto", "use": [ { @@ -2060,332 +2082,21 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "test": /\\\\\\.m\\?js/, }, { - "oneOf": [ - { - "generator": { - "filename": "static/image/[name].[contenthash:8][ext]", - }, - "resourceQuery": /\\(__inline=false\\|url\\)/, - "type": "asset/resource", - }, - { - "resourceQuery": /inline/, - "type": "asset/inline", - }, - { - "generator": { - "filename": "static/image/[name].[contenthash:8][ext]", - }, - "parser": { - "dataUrlCondition": { - "maxSize": 10000, - }, - }, - "type": "asset", - }, - ], - "test": /\\\\\\.\\(\\?:png\\|jpg\\|jpeg\\|pjpeg\\|pjp\\|gif\\|bmp\\|webp\\|ico\\|apng\\|avif\\|tif\\|tiff\\|jfif\\)\\$/i, - }, - { - "oneOf": [ - { - "generator": { - "filename": "static/media/[name].[contenthash:8][ext]", - }, - "resourceQuery": /\\(__inline=false\\|url\\)/, - "type": "asset/resource", - }, - { - "resourceQuery": /inline/, - "type": "asset/inline", - }, - { - "generator": { - "filename": "static/media/[name].[contenthash:8][ext]", - }, - "parser": { - "dataUrlCondition": { - "maxSize": 10000, - }, - }, - "type": "asset", - }, - ], - "test": /\\\\\\.\\(\\?:mp4\\|webm\\|ogg\\|mov\\|mp3\\|wav\\|flac\\|aac\\|m4a\\|opus\\)\\$/i, - }, - { - "oneOf": [ - { - "generator": { - "filename": "static/font/[name].[contenthash:8][ext]", - }, - "resourceQuery": /\\(__inline=false\\|url\\)/, - "type": "asset/resource", - }, - { - "resourceQuery": /inline/, - "type": "asset/inline", - }, + "include": [ { - "generator": { - "filename": "static/font/[name].[contenthash:8][ext]", - }, - "parser": { - "dataUrlCondition": { - "maxSize": 10000, + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, }, - }, - "type": "asset", + ], }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, ], - "test": /\\\\\\.\\(\\?:woff\\|woff2\\|eot\\|ttf\\|otf\\|ttc\\)\\$/i, - }, - { - "dependency": "url", - "generator": { - "filename": "static/wasm/[hash].module.wasm", - }, - "test": /\\\\\\.wasm\\$/, - "type": "asset/resource", - }, - { - "resolve": { - "preferRelative": true, - }, - "sideEffects": true, - "test": /\\\\\\.css\\$/, + "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "use": [ { - "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", - "options": { - "importLoaders": 1, - "modules": { - "auto": true, - "exportLocalsConvention": "camelCase", - "localIdentName": "[path][name]__[local]-[hash:base64:6]", - }, - "sourceMap": true, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", - "options": { - "postcssOptions": { - "config": false, - "plugins": [ - [Function], - { - "browsers": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - "info": [Function], - "options": { - "flexbox": "no-2009", - "overrideBrowserslist": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "postcssPlugin": "autoprefixer", - "prepare": [Function], - }, - [Function], - [Function], - [Function], - [Function], - [Function], - [Function], - ], - }, - "sourceMap": true, - }, - }, - ], - }, - { - "resolve": { - "preferRelative": true, - }, - "sideEffects": true, - "test": /\\\\\\.s\\(\\?:a\\|c\\)ss\\$/, - "use": [ - { - "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", - "options": { - "importLoaders": 3, - "modules": { - "auto": true, - "exportLocalsConvention": "camelCase", - "localIdentName": "[path][name]__[local]-[hash:base64:6]", - }, - "sourceMap": true, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", - "options": { - "postcssOptions": { - "config": false, - "plugins": [ - [Function], - { - "browsers": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - "info": [Function], - "options": { - "flexbox": "no-2009", - "overrideBrowserslist": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "postcssPlugin": "autoprefixer", - "prepare": [Function], - }, - [Function], - [Function], - [Function], - [Function], - [Function], - [Function], - ], - }, - "sourceMap": true, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/resolve-url-loader", - "options": { - "join": [Function], - "sourceMap": false, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/sass-loader", - "options": { - "implementation": "/node_modules//@rsbuild/shared/compiled/sass", - "sourceMap": true, - }, - }, - ], - }, - { - "resolve": { - "preferRelative": true, - }, - "sideEffects": true, - "test": /\\\\\\.less\\$/, - "use": [ - { - "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", - "options": { - "importLoaders": 2, - "modules": { - "auto": true, - "exportLocalsConvention": "camelCase", - "localIdentName": "[path][name]__[local]-[hash:base64:6]", - }, - "sourceMap": true, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", - "options": { - "postcssOptions": { - "config": false, - "plugins": [ - [Function], - { - "browsers": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - "info": [Function], - "options": { - "flexbox": "no-2009", - "overrideBrowserslist": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "postcssPlugin": "autoprefixer", - "prepare": [Function], - }, - [Function], - [Function], - [Function], - [Function], - [Function], - [Function], - ], - }, - "sourceMap": true, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/less-loader", - "options": { - "implementation": "/node_modules//@rsbuild/shared/compiled/less", - "lessOptions": { - "javascriptEnabled": true, - }, - "sourceMap": true, - }, - }, - ], - }, - { - "test": /\\\\\\.toml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", - }, - ], - }, - { - "test": /\\\\\\.ya\\?ml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", - }, - ], - }, - { - "include": [ - { - "and": [ - "", - { - "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, - }, - ], - }, - /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, - ], - "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, - "use": [ - { - "loader": "/node_modules//babel-loader/lib/index.js", + "loader": "/node_modules//babel-loader/lib/index.js", "options": { "babelrc": false, "compact": false, @@ -2496,7 +2207,7 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -2513,6 +2224,9 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "application/javascript", ], }, + "resolve": { + "fullySpecified": false, + }, "use": [ { "loader": "/node_modules//babel-loader/lib/index.js", @@ -2620,7 +2334,7 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -2634,36 +2348,18 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "oneOf": [ { "generator": { - "filename": "static/svg/[name].[contenthash:8].svg", - }, - "issuer": { - "not": [ - /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, - /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, - ], + "filename": "static/image/[name].[contenthash:8][ext]", }, "resourceQuery": /\\(__inline=false\\|url\\)/, "type": "asset/resource", }, { - "issuer": { - "not": [ - /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, - /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, - ], - }, "resourceQuery": /inline/, "type": "asset/inline", }, { "generator": { - "filename": "static/svg/[name].[contenthash:8].svg", - }, - "issuer": { - "not": [ - /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, - /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, - ], + "filename": "static/image/[name].[contenthash:8][ext]", }, "parser": { "dataUrlCondition": { @@ -2672,13 +2368,345 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` }, "type": "asset", }, + ], + "test": /\\\\\\.\\(\\?:png\\|jpg\\|jpeg\\|pjpeg\\|pjp\\|gif\\|bmp\\|webp\\|ico\\|apng\\|avif\\|tif\\|tiff\\|jfif\\)\\$/i, + }, + { + "oneOf": [ + { + "generator": { + "filename": "static/media/[name].[contenthash:8][ext]", + }, + "resourceQuery": /\\(__inline=false\\|url\\)/, + "type": "asset/resource", + }, { "resourceQuery": /inline/, "type": "asset/inline", }, { "generator": { - "filename": "static/svg/[name].[contenthash:8].svg", + "filename": "static/media/[name].[contenthash:8][ext]", + }, + "parser": { + "dataUrlCondition": { + "maxSize": 10000, + }, + }, + "type": "asset", + }, + ], + "test": /\\\\\\.\\(\\?:mp4\\|webm\\|ogg\\|mov\\|mp3\\|wav\\|flac\\|aac\\|m4a\\|opus\\)\\$/i, + }, + { + "oneOf": [ + { + "generator": { + "filename": "static/font/[name].[contenthash:8][ext]", + }, + "resourceQuery": /\\(__inline=false\\|url\\)/, + "type": "asset/resource", + }, + { + "resourceQuery": /inline/, + "type": "asset/inline", + }, + { + "generator": { + "filename": "static/font/[name].[contenthash:8][ext]", + }, + "parser": { + "dataUrlCondition": { + "maxSize": 10000, + }, + }, + "type": "asset", + }, + ], + "test": /\\\\\\.\\(\\?:woff\\|woff2\\|eot\\|ttf\\|otf\\|ttc\\)\\$/i, + }, + { + "dependency": "url", + "generator": { + "filename": "static/wasm/[hash].module.wasm", + }, + "test": /\\\\\\.wasm\\$/, + "type": "asset/resource", + }, + { + "resolve": { + "preferRelative": true, + }, + "sideEffects": true, + "test": /\\\\\\.css\\$/, + "use": [ + { + "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", + "options": { + "importLoaders": 1, + "modules": { + "auto": true, + "exportLocalsConvention": "camelCase", + "localIdentName": "[path][name]__[local]-[hash:base64:6]", + }, + "sourceMap": true, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", + "options": { + "postcssOptions": { + "config": false, + "plugins": [ + { + "browsers": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "info": [Function], + "options": { + "flexbox": "no-2009", + "overrideBrowserslist": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "postcssPlugin": "autoprefixer", + "prepare": [Function], + }, + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + ], + }, + "sourceMap": true, + }, + }, + ], + }, + { + "resolve": { + "preferRelative": true, + }, + "sideEffects": true, + "test": /\\\\\\.s\\(\\?:a\\|c\\)ss\\$/, + "use": [ + { + "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", + "options": { + "importLoaders": 3, + "modules": { + "auto": true, + "exportLocalsConvention": "camelCase", + "localIdentName": "[path][name]__[local]-[hash:base64:6]", + }, + "sourceMap": true, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", + "options": { + "postcssOptions": { + "config": false, + "plugins": [ + { + "browsers": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "info": [Function], + "options": { + "flexbox": "no-2009", + "overrideBrowserslist": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "postcssPlugin": "autoprefixer", + "prepare": [Function], + }, + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + ], + }, + "sourceMap": true, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/resolve-url-loader", + "options": { + "join": [Function], + "sourceMap": false, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/sass-loader", + "options": { + "implementation": "/node_modules//@rsbuild/shared/compiled/sass", + "sourceMap": true, + }, + }, + ], + }, + { + "resolve": { + "preferRelative": true, + }, + "sideEffects": true, + "test": /\\\\\\.less\\$/, + "use": [ + { + "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", + "options": { + "importLoaders": 2, + "modules": { + "auto": true, + "exportLocalsConvention": "camelCase", + "localIdentName": "[path][name]__[local]-[hash:base64:6]", + }, + "sourceMap": true, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", + "options": { + "postcssOptions": { + "config": false, + "plugins": [ + { + "browsers": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "info": [Function], + "options": { + "flexbox": "no-2009", + "overrideBrowserslist": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "postcssPlugin": "autoprefixer", + "prepare": [Function], + }, + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + ], + }, + "sourceMap": true, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/less-loader", + "options": { + "implementation": "/node_modules//@rsbuild/shared/compiled/less", + "lessOptions": { + "javascriptEnabled": true, + "paths": [ + "node_modules", + ], + }, + "sourceMap": true, + }, + }, + ], + }, + { + "test": /\\\\\\.toml\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", + }, + ], + }, + { + "test": /\\\\\\.ya\\?ml\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", + }, + ], + }, + { + "oneOf": [ + { + "generator": { + "filename": "static/svg/[name].[contenthash:8].svg", + }, + "issuer": { + "not": [ + /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, + /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, + ], + }, + "resourceQuery": /\\(__inline=false\\|url\\)/, + "type": "asset/resource", + }, + { + "issuer": { + "not": [ + /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, + /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, + ], + }, + "resourceQuery": /inline/, + "type": "asset/inline", + }, + { + "generator": { + "filename": "static/svg/[name].[contenthash:8].svg", + }, + "issuer": { + "not": [ + /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, + /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, + ], + }, + "parser": { + "dataUrlCondition": { + "maxSize": 10000, + }, + }, + "type": "asset", + }, + { + "resourceQuery": /inline/, + "type": "asset/inline", + }, + { + "generator": { + "filename": "static/svg/[name].[contenthash:8].svg", }, "resourceQuery": /url/, "type": "asset/resource", @@ -2783,7 +2811,7 @@ exports[`uni-builder webpack > should generator webpack config correctly 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -3081,6 +3109,275 @@ exports[`uni-builder webpack > should generator webpack config correctly when pr }, "test": /\\\\\\.m\\?js/, }, + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, + "use": [ + { + "loader": "/node_modules//babel-loader/lib/index.js", + "options": { + "babelrc": false, + "compact": true, + "configFile": false, + "plugins": [ + [ + "/node_modules//@babel/plugin-proposal-decorators/lib/index.js", + { + "version": "legacy", + }, + ], + "/node_modules//@babel/plugin-proposal-export-default-from/lib/index.js", + "/node_modules//@babel/plugin-proposal-partial-application/lib/index.js", + [ + "/node_modules//@babel/plugin-proposal-pipeline-operator/lib/index.js", + { + "proposal": "minimal", + }, + ], + [ + "/node_modules//@babel/plugin-transform-runtime/lib/index.js", + { + "useESModules": true, + "version": "7.23.2", + }, + ], + "/node_modules//@rsbuild/babel-preset/dist/pluginLockCorejsVersion", + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + "antd", + ], + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "camel2DashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + "@arco-design/web-react", + ], + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "camel2DashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + "@arco-design/web-react/icon", + ], + [ + "/compiled/babel-plugin-lodash/index.js", + {}, + ], + [ + "/node_modules//babel-plugin-transform-react-remove-prop-types/lib/index.js", + { + "removeImport": true, + }, + ], + [ + "/node_modules//babel-plugin-styled-components/lib/index.js", + { + "displayName": true, + "pure": true, + "ssr": false, + "transpileTemplateLiterals": true, + }, + ], + ], + "presets": [ + [ + "/node_modules//@babel/preset-env/lib/index.js", + { + "bugfixes": true, + "corejs": { + "proposals": true, + "version": "3.32", + }, + "exclude": [ + "transform-typeof-symbol", + ], + "modules": false, + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "useBuiltIns": "entry", + }, + ], + [ + "/node_modules//@babel/preset-typescript/lib/index.js", + { + "allExtensions": true, + "allowDeclareFields": true, + "allowNamespaces": true, + "isTSX": true, + "optimizeConstEnums": true, + }, + ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": false, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], + ], + }, + }, + ], + }, + { + "mimetype": { + "or": [ + "text/javascript", + "application/javascript", + ], + }, + "resolve": { + "fullySpecified": false, + }, + "use": [ + { + "loader": "/node_modules//babel-loader/lib/index.js", + "options": { + "babelrc": false, + "compact": true, + "configFile": false, + "plugins": [ + [ + "/node_modules//@babel/plugin-proposal-decorators/lib/index.js", + { + "version": "legacy", + }, + ], + "/node_modules//@babel/plugin-proposal-export-default-from/lib/index.js", + "/node_modules//@babel/plugin-proposal-partial-application/lib/index.js", + [ + "/node_modules//@babel/plugin-proposal-pipeline-operator/lib/index.js", + { + "proposal": "minimal", + }, + ], + [ + "/node_modules//@babel/plugin-transform-runtime/lib/index.js", + { + "useESModules": true, + "version": "7.23.2", + }, + ], + "/node_modules//@rsbuild/babel-preset/dist/pluginLockCorejsVersion", + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + "antd", + ], + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "camel2DashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + "@arco-design/web-react", + ], + [ + "/node_modules//babel-plugin-import/lib/index.js", + { + "camel2DashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + "@arco-design/web-react/icon", + ], + [ + "/compiled/babel-plugin-lodash/index.js", + {}, + ], + [ + "/node_modules//babel-plugin-transform-react-remove-prop-types/lib/index.js", + { + "removeImport": true, + }, + ], + [ + "/node_modules//babel-plugin-styled-components/lib/index.js", + { + "displayName": true, + "pure": true, + "ssr": false, + "transpileTemplateLiterals": true, + }, + ], + ], + "presets": [ + [ + "/node_modules//@babel/preset-env/lib/index.js", + { + "bugfixes": true, + "corejs": { + "proposals": true, + "version": "3.32", + }, + "exclude": [ + "transform-typeof-symbol", + ], + "modules": false, + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "useBuiltIns": "entry", + }, + ], + [ + "/node_modules//@babel/preset-typescript/lib/index.js", + { + "allExtensions": true, + "allowDeclareFields": true, + "allowNamespaces": true, + "isTSX": true, + "optimizeConstEnums": true, + }, + ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": false, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], + ], + }, + }, + ], + }, { "oneOf": [ { @@ -3198,7 +3495,6 @@ exports[`uni-builder webpack > should generator webpack config correctly when pr "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "> 0.01%", @@ -3223,6 +3519,7 @@ exports[`uni-builder webpack > should generator webpack config correctly when pr [Function], [Function], [Function], + [Function], ], }, "sourceMap": false, @@ -3252,412 +3549,149 @@ exports[`uni-builder webpack > should generator webpack config correctly when pr "sourceMap": false, }, }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", - "options": { - "postcssOptions": { - "config": false, - "plugins": [ - [Function], - { - "browsers": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - "info": [Function], - "options": { - "flexbox": "no-2009", - "overrideBrowserslist": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "postcssPlugin": "autoprefixer", - "prepare": [Function], - }, - [Function], - [Function], - [Function], - [Function], - [Function], - [Function], - ], - }, - "sourceMap": false, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/resolve-url-loader", - "options": { - "join": [Function], - "sourceMap": false, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/sass-loader", - "options": { - "implementation": "/node_modules//@rsbuild/shared/compiled/sass", - "sourceMap": true, - }, - }, - ], - }, - { - "resolve": { - "preferRelative": true, - }, - "sideEffects": true, - "test": /\\\\\\.less\\$/, - "use": [ - { - "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", - "options": { - "importLoaders": 2, - "modules": { - "auto": true, - "exportLocalsConvention": "camelCase", - "localIdentName": "[local]-[hash:base64:6]", - }, - "sourceMap": false, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", - "options": { - "postcssOptions": { - "config": false, - "plugins": [ - [Function], - { - "browsers": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - "info": [Function], - "options": { - "flexbox": "no-2009", - "overrideBrowserslist": [ - "> 0.01%", - "not dead", - "not op_mini all", - ], - }, - "postcssPlugin": "autoprefixer", - "prepare": [Function], - }, - [Function], - [Function], - [Function], - [Function], - [Function], - [Function], - ], - }, - "sourceMap": false, - }, - }, - { - "loader": "/node_modules//@rsbuild/shared/compiled/less-loader", - "options": { - "implementation": "/node_modules//@rsbuild/shared/compiled/less", - "lessOptions": { - "javascriptEnabled": true, - }, - "sourceMap": false, - }, - }, - ], - }, - { - "test": /\\\\\\.toml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", - }, - ], - }, - { - "test": /\\\\\\.ya\\?ml\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", - }, - ], - }, - { - "include": [ - { - "and": [ - "", - { - "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, - }, - ], - }, - /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, - ], - "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, - "use": [ - { - "loader": "/node_modules//babel-loader/lib/index.js", - "options": { - "babelrc": false, - "compact": true, - "configFile": false, - "plugins": [ - [ - "/node_modules//@babel/plugin-proposal-decorators/lib/index.js", - { - "version": "legacy", - }, - ], - "/node_modules//@babel/plugin-proposal-export-default-from/lib/index.js", - "/node_modules//@babel/plugin-proposal-partial-application/lib/index.js", - [ - "/node_modules//@babel/plugin-proposal-pipeline-operator/lib/index.js", - { - "proposal": "minimal", - }, - ], - [ - "/node_modules//@babel/plugin-transform-runtime/lib/index.js", - { - "useESModules": true, - "version": "7.23.2", - }, - ], - "/node_modules//@rsbuild/babel-preset/dist/pluginLockCorejsVersion", - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - "antd", - ], - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "camel2DashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - "@arco-design/web-react", - ], - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "camel2DashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - "@arco-design/web-react/icon", - ], - [ - "/compiled/babel-plugin-lodash/index.js", - {}, - ], - [ - "/node_modules//babel-plugin-transform-react-remove-prop-types/lib/index.js", - { - "removeImport": true, - }, - ], - [ - "/node_modules//babel-plugin-styled-components/lib/index.js", - { - "displayName": true, - "pure": true, - "ssr": false, - "transpileTemplateLiterals": true, - }, - ], - ], - "presets": [ - [ - "/node_modules//@babel/preset-env/lib/index.js", + { + "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", + "options": { + "postcssOptions": { + "config": false, + "plugins": [ { - "bugfixes": true, - "corejs": { - "proposals": true, - "version": "3.32", - }, - "exclude": [ - "transform-typeof-symbol", - ], - "modules": false, - "targets": [ + "browsers": [ "> 0.01%", "not dead", "not op_mini all", ], - "useBuiltIns": "entry", - }, - ], - [ - "/node_modules//@babel/preset-typescript/lib/index.js", - { - "allExtensions": true, - "allowDeclareFields": true, - "allowNamespaces": true, - "isTSX": true, - "optimizeConstEnums": true, - }, - ], - [ - "/node_modules//@babel/preset-react/lib/index.js", - { - "development": false, - "runtime": "classic", - "useBuiltIns": true, - "useSpread": false, + "info": [Function], + "options": { + "flexbox": "no-2009", + "overrideBrowserslist": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "postcssPlugin": "autoprefixer", + "prepare": [Function], }, + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], ], - ], + }, + "sourceMap": false, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/resolve-url-loader", + "options": { + "join": [Function], + "sourceMap": false, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/sass-loader", + "options": { + "implementation": "/node_modules//@rsbuild/shared/compiled/sass", + "sourceMap": true, }, }, ], }, { - "mimetype": { - "or": [ - "text/javascript", - "application/javascript", - ], + "resolve": { + "preferRelative": true, }, + "sideEffects": true, + "test": /\\\\\\.less\\$/, "use": [ { - "loader": "/node_modules//babel-loader/lib/index.js", + "loader": "/node_modules//mini-css-extract-plugin/dist/loader.js", + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/css-loader", "options": { - "babelrc": false, - "compact": true, - "configFile": false, - "plugins": [ - [ - "/node_modules//@babel/plugin-proposal-decorators/lib/index.js", - { - "version": "legacy", - }, - ], - "/node_modules//@babel/plugin-proposal-export-default-from/lib/index.js", - "/node_modules//@babel/plugin-proposal-partial-application/lib/index.js", - [ - "/node_modules//@babel/plugin-proposal-pipeline-operator/lib/index.js", - { - "proposal": "minimal", - }, - ], - [ - "/node_modules//@babel/plugin-transform-runtime/lib/index.js", - { - "useESModules": true, - "version": "7.23.2", - }, - ], - "/node_modules//@rsbuild/babel-preset/dist/pluginLockCorejsVersion", - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - "antd", - ], - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "camel2DashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - "@arco-design/web-react", - ], - [ - "/node_modules//babel-plugin-import/lib/index.js", - { - "camel2DashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - "@arco-design/web-react/icon", - ], - [ - "/compiled/babel-plugin-lodash/index.js", - {}, - ], - [ - "/node_modules//babel-plugin-transform-react-remove-prop-types/lib/index.js", - { - "removeImport": true, - }, - ], - [ - "/node_modules//babel-plugin-styled-components/lib/index.js", - { - "displayName": true, - "pure": true, - "ssr": false, - "transpileTemplateLiterals": true, - }, - ], - ], - "presets": [ - [ - "/node_modules//@babel/preset-env/lib/index.js", + "importLoaders": 2, + "modules": { + "auto": true, + "exportLocalsConvention": "camelCase", + "localIdentName": "[local]-[hash:base64:6]", + }, + "sourceMap": false, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/postcss-loader", + "options": { + "postcssOptions": { + "config": false, + "plugins": [ { - "bugfixes": true, - "corejs": { - "proposals": true, - "version": "3.32", - }, - "exclude": [ - "transform-typeof-symbol", - ], - "modules": false, - "targets": [ + "browsers": [ "> 0.01%", "not dead", "not op_mini all", ], - "useBuiltIns": "entry", - }, - ], - [ - "/node_modules//@babel/preset-typescript/lib/index.js", - { - "allExtensions": true, - "allowDeclareFields": true, - "allowNamespaces": true, - "isTSX": true, - "optimizeConstEnums": true, + "info": [Function], + "options": { + "flexbox": "no-2009", + "overrideBrowserslist": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + }, + "postcssPlugin": "autoprefixer", + "prepare": [Function], }, + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], + [Function], ], - [ - "/node_modules//@babel/preset-react/lib/index.js", - { - "development": false, - "runtime": "classic", - "useBuiltIns": true, - "useSpread": false, - }, + }, + "sourceMap": false, + }, + }, + { + "loader": "/node_modules//@rsbuild/shared/compiled/less-loader", + "options": { + "implementation": "/node_modules//@rsbuild/shared/compiled/less", + "lessOptions": { + "javascriptEnabled": true, + "paths": [ + "node_modules", ], - ], + }, + "sourceMap": false, }, }, ], }, + { + "test": /\\\\\\.toml\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "/node_modules//@rsbuild/plugin-toml/compiled/toml-loader", + }, + ], + }, + { + "test": /\\\\\\.ya\\?ml\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "/node_modules//@rsbuild/plugin-yaml/compiled/yaml-loader", + }, + ], + }, { "oneOf": [ { @@ -3826,7 +3860,7 @@ exports[`uni-builder webpack > should generator webpack config correctly when pr "/node_modules//@babel/preset-react/lib/index.js", { "development": false, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, diff --git a/packages/builder/uni-builder/tests/__snapshots__/postcssLegacy.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/postcssLegacy.test.ts.snap index 3d8b628b5858..f37c0139cbcf 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/postcssLegacy.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/postcssLegacy.test.ts.snap @@ -14,6 +14,152 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, "test": /\\\\\\.m\\?js/, }, + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, + "type": "javascript/auto", + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "chrome >= 87", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": false, + "refresh": true, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": false, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": true, + }, + }, + ], + }, + { + "mimetype": { + "or": [ + "text/javascript", + "application/javascript", + ], + }, + "resolve": { + "fullySpecified": false, + }, + "use": [ + { + "loader": "builtin:swc-loader", + "options": { + "env": { + "coreJs": "3.32", + "mode": "entry", + "targets": [ + "chrome >= 87", + ], + }, + "isModule": "unknown", + "jsc": { + "externalHelpers": true, + "parser": { + "decorators": true, + "syntax": "typescript", + "tsx": true, + }, + "preserveAllComments": true, + "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, + "react": { + "development": false, + "refresh": true, + "runtime": "automatic", + }, + }, + }, + "rspackExperiments": { + "import": [ + { + "libraryDirectory": "es", + "libraryName": "antd", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "es", + "libraryName": "@arco-design/web-react", + "style": true, + }, + { + "camelToDashComponentName": false, + "libraryDirectory": "react-icon", + "libraryName": "@arco-design/web-react/icon", + }, + ], + "styledComponents": { + "displayName": true, + "pure": false, + "ssr": false, + "transpileTemplateLiterals": true, + }, + }, + "sourceMaps": true, + }, + }, + ], + }, { "oneOf": [ { @@ -119,7 +265,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -136,6 +281,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -156,7 +302,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -173,6 +318,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -199,7 +345,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -216,6 +361,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -227,6 +373,9 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": true, }, @@ -246,7 +395,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -263,6 +411,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -274,6 +423,9 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "implementation": "/node_modules//@rsbuild/shared/compiled/less", "lessOptions": { "javascriptEnabled": true, + "paths": [ + "node_modules", + ], }, "sourceMap": true, }, @@ -299,7 +451,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -316,6 +467,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -350,7 +502,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "postcssOptions": { "config": false, "plugins": [ - [Function], { "browsers": [ "chrome >= 87", @@ -367,6 +518,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 }, [Function], [Function], + [Function], ], }, "sourceMap": true, @@ -391,149 +543,6 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 ], "test": /\\\\\\.s\\(\\?:a\\|c\\)ss\\$/, }, - { - "include": [ - { - "and": [ - "", - { - "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, - }, - ], - }, - /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, - ], - "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, - "type": "javascript/auto", - "use": [ - { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "chrome >= 87", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": true, - "refresh": true, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": false, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": true, - }, - }, - ], - }, - { - "mimetype": { - "or": [ - "text/javascript", - "application/javascript", - ], - }, - "use": [ - { - "loader": "builtin:swc-loader", - "options": { - "env": { - "coreJs": "3.32", - "mode": "entry", - "targets": [ - "chrome >= 87", - ], - }, - "isModule": "unknown", - "jsc": { - "externalHelpers": true, - "parser": { - "decorators": true, - "syntax": "typescript", - "tsx": true, - }, - "preserveAllComments": true, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true, - "react": { - "development": true, - "refresh": true, - "runtime": "automatic", - }, - }, - }, - "rspackExperiments": { - "import": [ - { - "libraryDirectory": "es", - "libraryName": "antd", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "es", - "libraryName": "@arco-design/web-react", - "style": true, - }, - { - "camelToDashComponentName": false, - "libraryDirectory": "react-icon", - "libraryName": "@arco-design/web-react/icon", - }, - ], - "styledComponents": { - "displayName": true, - "pure": false, - "ssr": false, - "transpileTemplateLiterals": true, - }, - }, - "sourceMaps": true, - }, - }, - ], - }, { "test": /\\\\\\.toml\\$/, "type": "javascript/auto", @@ -631,7 +640,7 @@ exports[`plugin-postcssLegacy > should register postcss plugin by browserslist 1 "decoratorMetadata": true, "legacyDecorator": true, "react": { - "development": true, + "development": false, "refresh": true, "runtime": "automatic", }, diff --git a/packages/builder/uni-builder/tests/__snapshots__/react.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/react.test.ts.snap index e4008cdd60e5..0267452bef58 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/react.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/react.test.ts.snap @@ -134,7 +134,7 @@ exports[`plugins/react > should work with babel-loader 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, diff --git a/packages/builder/uni-builder/tests/__snapshots__/styledComponents.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/styledComponents.test.ts.snap index a706dab99ea5..c9465ef08c9a 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/styledComponents.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/styledComponents.test.ts.snap @@ -113,7 +113,7 @@ exports[`plugins/styled-components > should enable ssr when target contain node "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -260,7 +260,7 @@ exports[`plugins/styled-components > should enable ssr when target contain node "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -407,7 +407,7 @@ exports[`plugins/styled-components > should works in webpack babel mode 1`] = ` "/node_modules//@babel/preset-react/lib/index.js", { "development": true, - "runtime": "classic", + "runtime": "automatic", "useBuiltIns": true, "useSpread": false, }, @@ -501,6 +501,8 @@ exports[`plugins/styled-components > should works in webpack swc mode 1`] = ` }, "preserveAllComments": true, "transform": { + "decoratorMetadata": true, + "legacyDecorator": true, "react": { "refresh": true, "runtime": "classic", diff --git a/packages/builder/uni-builder/tests/__snapshots__/tsLoader.test.ts.snap b/packages/builder/uni-builder/tests/__snapshots__/tsLoader.test.ts.snap index fc200f75080a..7ed291e6135b 100644 --- a/packages/builder/uni-builder/tests/__snapshots__/tsLoader.test.ts.snap +++ b/packages/builder/uni-builder/tests/__snapshots__/tsLoader.test.ts.snap @@ -1,5 +1,194 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`plugin-ts-loader > should insert babel plugin correctly in some edge case 1`] = ` +[ + { + "resolve": { + "fullySpecified": false, + }, + "test": /\\\\\\.m\\?js/, + }, + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:js\\|mjs\\|cjs\\|jsx\\)\\$/, + "use": [ + { + "loader": "/node_modules//babel-loader/lib/index.js", + "options": { + "babelrc": false, + "compact": true, + "configFile": false, + "plugins": [ + [ + "babel-plugin-xxx", + ], + [ + "babel-plugin-import", + { + "libraryDirectory": "es", + "libraryName": "xxx-components", + "style": true, + }, + ], + [ + "/node_modules//babel-plugin-styled-components/lib/index.js", + { + "displayName": true, + "pure": true, + "ssr": false, + "transpileTemplateLiterals": true, + }, + ], + ], + "presets": [ + [ + "/node_modules//@babel/preset-env/lib/index.js", + { + "bugfixes": true, + "corejs": { + "proposals": true, + "version": "3.32", + }, + "exclude": [ + "transform-typeof-symbol", + ], + "modules": false, + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "useBuiltIns": "entry", + }, + ], + [ + "/node_modules//@babel/preset-typescript/lib/index.js", + { + "allExtensions": true, + "allowDeclareFields": true, + "allowNamespaces": true, + "isTSX": true, + "optimizeConstEnums": true, + }, + ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": false, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], + ], + }, + }, + ], + }, +] +`; + +exports[`plugin-ts-loader > should insert babel plugin correctly in some edge case 2`] = ` +[ + { + "include": [ + { + "and": [ + "", + { + "not": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/, + }, + ], + }, + /\\\\\\.\\(\\?:ts\\|tsx\\|jsx\\|mts\\|cts\\)\\$/, + ], + "test": /\\\\\\.\\(\\?:ts\\|mts\\|cts\\|tsx\\)\\$/, + "use": [ + { + "loader": "/node_modules//babel-loader/lib/index.js", + "options": { + "plugins": [ + [ + "babel-plugin-xxx", + ], + [ + "babel-plugin-import", + { + "libraryDirectory": "es", + "libraryName": "xxx-components", + "style": true, + }, + ], + ], + "presets": [ + [ + "/node_modules//@babel/preset-env/lib/index.js", + { + "bugfixes": true, + "corejs": { + "proposals": true, + "version": "3.32", + }, + "exclude": [ + "transform-typeof-symbol", + ], + "modules": false, + "targets": [ + "> 0.01%", + "not dead", + "not op_mini all", + ], + "useBuiltIns": "entry", + }, + ], + [ + "/node_modules//@babel/preset-typescript/lib/index.js", + { + "allExtensions": true, + "allowDeclareFields": true, + "allowNamespaces": true, + "isTSX": true, + "optimizeConstEnums": true, + }, + ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": false, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], + ], + }, + }, + { + "loader": "/node_modules//ts-loader/index.js", + "options": { + "allowTsInNodeModules": true, + "compilerOptions": { + "module": "esnext", + "target": "esnext", + }, + "transpileOnly": true, + }, + }, + ], + }, +] +`; + exports[`plugin-ts-loader > should set include/exclude 1`] = ` [ { @@ -78,6 +267,15 @@ exports[`plugin-ts-loader > should set include/exclude 1`] = ` "optimizeConstEnums": true, }, ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": true, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], ], }, }, @@ -171,6 +369,15 @@ exports[`plugin-ts-loader > should set ts-loader 1`] = ` "optimizeConstEnums": true, }, ], + [ + "/node_modules//@babel/preset-react/lib/index.js", + { + "development": true, + "runtime": "automatic", + "useBuiltIns": true, + "useSpread": false, + }, + ], ], }, }, diff --git a/packages/builder/uni-builder/tests/tsLoader.test.ts b/packages/builder/uni-builder/tests/tsLoader.test.ts index 736cad0b7db4..f4857cbf63c8 100644 --- a/packages/builder/uni-builder/tests/tsLoader.test.ts +++ b/packages/builder/uni-builder/tests/tsLoader.test.ts @@ -36,4 +36,68 @@ describe('plugin-ts-loader', () => { expect(matchRules({ config, testFile: 'a.ts' })).toMatchSnapshot(); }); + + it('should insert babel plugin correctly in some edge case', async () => { + const { NODE_ENV } = process.env; + process.env.NODE_ENV = 'production'; + + const rsbuild = await createUniBuilder({ + bundlerType: 'webpack', + config: { + tools: { + tsLoader: {}, + babel: { + plugins: [ + [ + 'babel-plugin-import', + { + libraryName: 'xxx-components', + libraryDirectory: 'es', + style: true, + }, + ], + ], + }, + webpackChain: (chain, { CHAIN_ID }) => { + const withBabelPlugin = (babelOptions: any) => { + if (typeof babelOptions !== 'object' || !babelOptions) { + return babelOptions; + } + + babelOptions.plugins = babelOptions.plugins || []; + babelOptions.plugins.unshift(['babel-plugin-xxx']); + return babelOptions; + }; + + if (chain.module.rules.has(CHAIN_ID.RULE.JS)) { + chain.module + .rule(CHAIN_ID.RULE.JS) + .use(CHAIN_ID.USE.BABEL) + .tap(withBabelPlugin); + } + if (chain.module.rules.has(CHAIN_ID.RULE.TS)) { + chain.module + .rule(CHAIN_ID.RULE.TS) + .use(CHAIN_ID.USE.BABEL) + .tap(withBabelPlugin); + } + }, + }, + }, + cwd: '', + }); + + const { + origin: { bundlerConfigs }, + } = await rsbuild.inspectConfig(); + + expect( + matchRules({ config: bundlerConfigs[0], testFile: 'a.js' }), + ).toMatchSnapshot(); + expect( + matchRules({ config: bundlerConfigs[0], testFile: 'a.ts' }), + ).toMatchSnapshot(); + + process.env.NODE_ENV = NODE_ENV; + }); }); diff --git a/packages/cli/plugin-swc/package.json b/packages/cli/plugin-swc/package.json index fdb385e19854..f2b0e6a7b119 100644 --- a/packages/cli/plugin-swc/package.json +++ b/packages/cli/plugin-swc/package.json @@ -37,7 +37,7 @@ "test": "jest" }, "dependencies": { - "@rsbuild/plugin-swc": "0.3.7", + "@rsbuild/plugin-swc": "0.4.0", "@modern-js/utils": "workspace:*", "@swc/helpers": "0.5.3" }, diff --git a/packages/devtools/client/package.json b/packages/devtools/client/package.json index 5c563eeeb9af..a935b951a195 100644 --- a/packages/devtools/client/package.json +++ b/packages/devtools/client/package.json @@ -42,7 +42,7 @@ "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-tabs": "^1.0.4", "@radix-ui/themes": "^2.0.0", - "@rsbuild/core": "0.3.7", + "@rsbuild/core": "0.4.0", "@types/jest": "^29", "@types/lodash": "^4.14.202", "@types/node": "~16.11.7", diff --git a/packages/devtools/plugin/src/rpc/index.ts b/packages/devtools/plugin/src/rpc/index.ts index be240cce8e1e..ec2dd3a883f0 100644 --- a/packages/devtools/plugin/src/rpc/index.ts +++ b/packages/devtools/plugin/src/rpc/index.ts @@ -193,7 +193,7 @@ export const setupClientConnection = async ( : api.modifyRspackConfig; const expectBundlerNum = _.castArray(api.context.targets).length; const bundlerConfigs: JsonValue[] = []; - modifyBundlerConfig(config => { + modifyBundlerConfig((config: any) => { bundlerConfigs.push(config as JsonValue); if (bundlerConfigs.length >= expectBundlerNum) { deferred.bundler.config.resolved.resolve( diff --git a/packages/document/builder-doc/package.json b/packages/document/builder-doc/package.json index 249249188108..fabda1afa8ae 100644 --- a/packages/document/builder-doc/package.json +++ b/packages/document/builder-doc/package.json @@ -28,10 +28,10 @@ }, "devDependencies": { "@modern-js/tsconfig": "workspace:*", - "rspress": "1.11.1", + "rspress": "1.11.2", "@types/node": "^14", "react": "^18.2.0", "react-dom": "^18.2.0", - "@rspress/shared": "1.11.1" + "@rspress/shared": "1.11.2" } } diff --git a/packages/document/main-doc/package.json b/packages/document/main-doc/package.json index a4e63665aa50..edd1fdbc77f2 100644 --- a/packages/document/main-doc/package.json +++ b/packages/document/main-doc/package.json @@ -43,8 +43,8 @@ "ts-node": "^10.9.1", "typescript": "^5", "fs-extra": "^10", - "rspress": "1.11.1", - "@rspress/shared": "1.11.1", + "rspress": "1.11.2", + "@rspress/shared": "1.11.2", "@types/node": "^16", "@types/fs-extra": "9.0.13" } diff --git a/packages/document/main-doc/scripts/summary.en.json b/packages/document/main-doc/scripts/summary.en.json index e1fbf0605c8c..c22ba4337efd 100644 --- a/packages/document/main-doc/scripts/summary.en.json +++ b/packages/document/main-doc/scripts/summary.en.json @@ -1,106 +1 @@ -[ - { "name": "assetPrefix", "dirname": "dev" }, - { "name": "beforeStartUrl", "dirname": "dev" }, - { "name": "hmr", "dirname": "dev" }, - { "name": "host", "dirname": "dev" }, - { "name": "https", "dirname": "dev" }, - { "name": "port", "dirname": "dev" }, - { "name": "progressBar", "dirname": "dev" }, - { "name": "startUrl", "dirname": "dev" }, - { "name": "lazyCompilation", "dirname": "experiments" }, - { "name": "sourceBuild", "dirname": "experiments" }, - { "name": "appIcon", "dirname": "html" }, - { "name": "crossorigin", "dirname": "html" }, - { "name": "disableHtmlFolder", "dirname": "html" }, - { "name": "favicon", "dirname": "html" }, - { "name": "faviconByEntries", "dirname": "html" }, - { "name": "inject", "dirname": "html" }, - { "name": "injectByEntries", "dirname": "html" }, - { "name": "meta", "dirname": "html" }, - { "name": "metaByEntries", "dirname": "html" }, - { "name": "mountId", "dirname": "html" }, - { "name": "scriptLoading", "dirname": "html" }, - { "name": "tags", "dirname": "html" }, - { "name": "tagsByEntries", "dirname": "html" }, - { "name": "template", "dirname": "html" }, - { "name": "templateByEntries", "dirname": "html" }, - { "name": "templateParameters", "dirname": "html" }, - { "name": "templateParametersByEntries", "dirname": "html" }, - { "name": "title", "dirname": "html" }, - { "name": "titleByEntries", "dirname": "html" }, - { "name": "assetPrefix", "dirname": "output" }, - { "name": "assetsRetry", "dirname": "output" }, - { "name": "charset", "dirname": "output" }, - { "name": "cleanDistPath", "dirname": "output" }, - { "name": "convertToRem", "dirname": "output" }, - { "name": "copy", "dirname": "output" }, - { "name": "cssModuleLocalIdentName", "dirname": "output" }, - { "name": "cssModules", "dirname": "output" }, - { "name": "dataUriLimit", "dirname": "output" }, - { "name": "disableCssExtract", "dirname": "output" }, - { "name": "disableCssModuleExtension", "dirname": "output" }, - { "name": "disableFilenameHash", "dirname": "output" }, - { "name": "disableInlineRuntimeChunk", "dirname": "output" }, - { "name": "disableMinimize", "dirname": "output" }, - { "name": "disableSourceMap", "dirname": "output" }, - { "name": "disableSvgr", "dirname": "output" }, - { "name": "disableTsChecker", "dirname": "output" }, - { "name": "distPath", "dirname": "output" }, - { "name": "enableAssetFallback", "dirname": "output" }, - { "name": "enableAssetManifest", "dirname": "output" }, - { "name": "enableCssModuleTSDeclaration", "dirname": "output" }, - { "name": "enableInlineScripts", "dirname": "output" }, - { "name": "enableInlineStyles", "dirname": "output" }, - { "name": "enableLatestDecorators", "dirname": "output" }, - { "name": "externals", "dirname": "output" }, - { "name": "filename", "dirname": "output" }, - { "name": "legalComments", "dirname": "output" }, - { "name": "overrideBrowserslist", "dirname": "output" }, - { "name": "polyfill", "dirname": "output" }, - { "name": "svgDefaultExport", "dirname": "output" }, - { "name": "buildCache", "dirname": "performance" }, - { "name": "bundleAnalyze", "dirname": "performance" }, - { "name": "chunkSplit", "dirname": "performance" }, - { "name": "dnsPrefetch", "dirname": "performance" }, - { "name": "preconnect", "dirname": "performance" }, - { "name": "prefetch", "dirname": "performance" }, - { "name": "preload", "dirname": "performance" }, - { "name": "printFileSize", "dirname": "performance" }, - { "name": "profile", "dirname": "performance" }, - { "name": "removeConsole", "dirname": "performance" }, - { "name": "removeMomentLocale", "dirname": "performance" }, - { "name": "transformLodash", "dirname": "performance" }, - { "name": "checkSyntax", "dirname": "security" }, - { "name": "nonce", "dirname": "security" }, - { "name": "sri", "dirname": "security" }, - { "name": "alias", "dirname": "source" }, - { "name": "aliasStrategy", "dirname": "source" }, - { "name": "define", "dirname": "source" }, - { "name": "exclude", "dirname": "source" }, - { "name": "globalVars", "dirname": "source" }, - { "name": "include", "dirname": "source" }, - { "name": "moduleScopes", "dirname": "source" }, - { "name": "preEntry", "dirname": "source" }, - { "name": "resolveExtensionPrefix", "dirname": "source" }, - { "name": "resolveMainFields", "dirname": "source" }, - { "name": "transformImport", "dirname": "source" }, - { "name": "autoprefixer", "dirname": "tools" }, - { "name": "babel", "dirname": "tools" }, - { "name": "cssExtract", "dirname": "tools" }, - { "name": "cssLoader", "dirname": "tools" }, - { "name": "devServer", "dirname": "tools" }, - { "name": "htmlPlugin", "dirname": "tools" }, - { "name": "less", "dirname": "tools" }, - { "name": "minifyCss", "dirname": "tools" }, - { "name": "postcss", "dirname": "tools" }, - { "name": "pug", "dirname": "tools" }, - { "name": "rspack", "dirname": "tools" }, - { "name": "sass", "dirname": "tools" }, - { "name": "styleLoader", "dirname": "tools" }, - { "name": "styledComponents", "dirname": "tools" }, - { "name": "terser", "dirname": "tools" }, - { "name": "tsChecker", "dirname": "tools" }, - { "name": "tsLoader", "dirname": "tools" }, - { "name": "webpack", "dirname": "tools" }, - { "name": "webpackChain", "dirname": "tools" } -] +[{"name":"assetPrefix","dirname":"dev"},{"name":"beforeStartUrl","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"host","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"sourceBuild","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"scriptLoading","dirname":"html"},{"name":"tags","dirname":"html"},{"name":"tagsByEntries","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"cssModules","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableSvgr","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"dnsPrefetch","dirname":"performance"},{"name":"preconnect","dirname":"performance"},{"name":"prefetch","dirname":"performance"},{"name":"preload","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"transformLodash","dirname":"performance"},{"name":"checkSyntax","dirname":"security"},{"name":"nonce","dirname":"security"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"aliasStrategy","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"transformImport","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"rspack","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}] diff --git a/packages/document/main-doc/scripts/summary.zh.json b/packages/document/main-doc/scripts/summary.zh.json index e1fbf0605c8c..c22ba4337efd 100644 --- a/packages/document/main-doc/scripts/summary.zh.json +++ b/packages/document/main-doc/scripts/summary.zh.json @@ -1,106 +1 @@ -[ - { "name": "assetPrefix", "dirname": "dev" }, - { "name": "beforeStartUrl", "dirname": "dev" }, - { "name": "hmr", "dirname": "dev" }, - { "name": "host", "dirname": "dev" }, - { "name": "https", "dirname": "dev" }, - { "name": "port", "dirname": "dev" }, - { "name": "progressBar", "dirname": "dev" }, - { "name": "startUrl", "dirname": "dev" }, - { "name": "lazyCompilation", "dirname": "experiments" }, - { "name": "sourceBuild", "dirname": "experiments" }, - { "name": "appIcon", "dirname": "html" }, - { "name": "crossorigin", "dirname": "html" }, - { "name": "disableHtmlFolder", "dirname": "html" }, - { "name": "favicon", "dirname": "html" }, - { "name": "faviconByEntries", "dirname": "html" }, - { "name": "inject", "dirname": "html" }, - { "name": "injectByEntries", "dirname": "html" }, - { "name": "meta", "dirname": "html" }, - { "name": "metaByEntries", "dirname": "html" }, - { "name": "mountId", "dirname": "html" }, - { "name": "scriptLoading", "dirname": "html" }, - { "name": "tags", "dirname": "html" }, - { "name": "tagsByEntries", "dirname": "html" }, - { "name": "template", "dirname": "html" }, - { "name": "templateByEntries", "dirname": "html" }, - { "name": "templateParameters", "dirname": "html" }, - { "name": "templateParametersByEntries", "dirname": "html" }, - { "name": "title", "dirname": "html" }, - { "name": "titleByEntries", "dirname": "html" }, - { "name": "assetPrefix", "dirname": "output" }, - { "name": "assetsRetry", "dirname": "output" }, - { "name": "charset", "dirname": "output" }, - { "name": "cleanDistPath", "dirname": "output" }, - { "name": "convertToRem", "dirname": "output" }, - { "name": "copy", "dirname": "output" }, - { "name": "cssModuleLocalIdentName", "dirname": "output" }, - { "name": "cssModules", "dirname": "output" }, - { "name": "dataUriLimit", "dirname": "output" }, - { "name": "disableCssExtract", "dirname": "output" }, - { "name": "disableCssModuleExtension", "dirname": "output" }, - { "name": "disableFilenameHash", "dirname": "output" }, - { "name": "disableInlineRuntimeChunk", "dirname": "output" }, - { "name": "disableMinimize", "dirname": "output" }, - { "name": "disableSourceMap", "dirname": "output" }, - { "name": "disableSvgr", "dirname": "output" }, - { "name": "disableTsChecker", "dirname": "output" }, - { "name": "distPath", "dirname": "output" }, - { "name": "enableAssetFallback", "dirname": "output" }, - { "name": "enableAssetManifest", "dirname": "output" }, - { "name": "enableCssModuleTSDeclaration", "dirname": "output" }, - { "name": "enableInlineScripts", "dirname": "output" }, - { "name": "enableInlineStyles", "dirname": "output" }, - { "name": "enableLatestDecorators", "dirname": "output" }, - { "name": "externals", "dirname": "output" }, - { "name": "filename", "dirname": "output" }, - { "name": "legalComments", "dirname": "output" }, - { "name": "overrideBrowserslist", "dirname": "output" }, - { "name": "polyfill", "dirname": "output" }, - { "name": "svgDefaultExport", "dirname": "output" }, - { "name": "buildCache", "dirname": "performance" }, - { "name": "bundleAnalyze", "dirname": "performance" }, - { "name": "chunkSplit", "dirname": "performance" }, - { "name": "dnsPrefetch", "dirname": "performance" }, - { "name": "preconnect", "dirname": "performance" }, - { "name": "prefetch", "dirname": "performance" }, - { "name": "preload", "dirname": "performance" }, - { "name": "printFileSize", "dirname": "performance" }, - { "name": "profile", "dirname": "performance" }, - { "name": "removeConsole", "dirname": "performance" }, - { "name": "removeMomentLocale", "dirname": "performance" }, - { "name": "transformLodash", "dirname": "performance" }, - { "name": "checkSyntax", "dirname": "security" }, - { "name": "nonce", "dirname": "security" }, - { "name": "sri", "dirname": "security" }, - { "name": "alias", "dirname": "source" }, - { "name": "aliasStrategy", "dirname": "source" }, - { "name": "define", "dirname": "source" }, - { "name": "exclude", "dirname": "source" }, - { "name": "globalVars", "dirname": "source" }, - { "name": "include", "dirname": "source" }, - { "name": "moduleScopes", "dirname": "source" }, - { "name": "preEntry", "dirname": "source" }, - { "name": "resolveExtensionPrefix", "dirname": "source" }, - { "name": "resolveMainFields", "dirname": "source" }, - { "name": "transformImport", "dirname": "source" }, - { "name": "autoprefixer", "dirname": "tools" }, - { "name": "babel", "dirname": "tools" }, - { "name": "cssExtract", "dirname": "tools" }, - { "name": "cssLoader", "dirname": "tools" }, - { "name": "devServer", "dirname": "tools" }, - { "name": "htmlPlugin", "dirname": "tools" }, - { "name": "less", "dirname": "tools" }, - { "name": "minifyCss", "dirname": "tools" }, - { "name": "postcss", "dirname": "tools" }, - { "name": "pug", "dirname": "tools" }, - { "name": "rspack", "dirname": "tools" }, - { "name": "sass", "dirname": "tools" }, - { "name": "styleLoader", "dirname": "tools" }, - { "name": "styledComponents", "dirname": "tools" }, - { "name": "terser", "dirname": "tools" }, - { "name": "tsChecker", "dirname": "tools" }, - { "name": "tsLoader", "dirname": "tools" }, - { "name": "webpack", "dirname": "tools" }, - { "name": "webpackChain", "dirname": "tools" } -] +[{"name":"assetPrefix","dirname":"dev"},{"name":"beforeStartUrl","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"host","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"sourceBuild","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"scriptLoading","dirname":"html"},{"name":"tags","dirname":"html"},{"name":"tagsByEntries","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"cssModules","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableSvgr","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"dnsPrefetch","dirname":"performance"},{"name":"preconnect","dirname":"performance"},{"name":"prefetch","dirname":"performance"},{"name":"preload","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"transformLodash","dirname":"performance"},{"name":"checkSyntax","dirname":"security"},{"name":"nonce","dirname":"security"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"aliasStrategy","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"transformImport","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"rspack","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}] diff --git a/packages/document/module-doc/docs/en/plugins/official-list/plugin-vue.mdx b/packages/document/module-doc/docs/en/plugins/official-list/plugin-vue.mdx index 09e8b14db44c..98306e486a76 100644 --- a/packages/document/module-doc/docs/en/plugins/official-list/plugin-vue.mdx +++ b/packages/document/module-doc/docs/en/plugins/official-list/plugin-vue.mdx @@ -8,6 +8,7 @@ Notice that we have some limitation: 1. The current implementation of this plugin integrates directly with the community plugin and therefore does not support writing jsx/tsx in sfc. 2. If you want to generate d.ts for the components, please use the official recommendation [vue-tsc](https://www.npmjs.com/package/vue-tsc). 3. Only support bundle, we recommend to set input to `['src/**/*.vue']` or `['src/index.ts']`. + ::: ## Quick start diff --git a/packages/document/module-doc/docs/zh/plugins/official-list/plugin-vue.mdx b/packages/document/module-doc/docs/zh/plugins/official-list/plugin-vue.mdx index cd6896d23e7d..5feacc56be75 100644 --- a/packages/document/module-doc/docs/zh/plugins/official-list/plugin-vue.mdx +++ b/packages/document/module-doc/docs/zh/plugins/official-list/plugin-vue.mdx @@ -8,6 +8,7 @@ Vue 插件提供了对 Vue 3 组件构建的支持,插件内部集成了 [esbu 1. 目前此插件的实现是直接集成社区插件,因此不支持在 sfc 里写 jsx/tsx。 2. 如果要为组件生成 d.ts,请使用官方推荐方式 [vue-tsc](https://www.npmjs.com/package/vue-tsc)。 3. 仅支持打包场景,推荐将 input 设置为 `['src/**/*.vue']` 或者 `['src/index.ts']`。 + ::: ## 快速开始 diff --git a/packages/document/module-doc/package.json b/packages/document/module-doc/package.json index f8dfc04c0d71..72dc0d498754 100644 --- a/packages/document/module-doc/package.json +++ b/packages/document/module-doc/package.json @@ -20,7 +20,7 @@ "@modern-js/doc-plugin-auto-sidebar": "workspace:*", "react": "^18.2.0", "react-dom": "^18.2.0", - "rspress": "1.11.1", - "@rspress/shared": "1.11.1" + "rspress": "1.11.2", + "@rspress/shared": "1.11.2" } } diff --git a/packages/review/eslint-config-app/package.json b/packages/review/eslint-config-app/package.json index 9d8fbdba2ff5..8c91b240f8bf 100644 --- a/packages/review/eslint-config-app/package.json +++ b/packages/review/eslint-config-app/package.json @@ -25,7 +25,7 @@ "@babel/core": "^7.23.2", "@babel/eslint-parser": "^7.22.15", "@babel/eslint-plugin": "^7.22.10", - "@rsbuild/babel-preset": "0.3.7", + "@rsbuild/babel-preset": "0.4.0", "@typescript-eslint/eslint-plugin": "^5.59.0", "@typescript-eslint/parser": "^5.59.0", "eslint": "^8.28.0", diff --git a/packages/runtime/plugin-garfish/src/cli/index.ts b/packages/runtime/plugin-garfish/src/cli/index.ts index f13e0472af99..abf013c46ee2 100644 --- a/packages/runtime/plugin-garfish/src/cli/index.ts +++ b/packages/runtime/plugin-garfish/src/cli/index.ts @@ -143,7 +143,7 @@ export const garfishPlugin = ({ // add comments avoid sourcemap abnormal if (bundler.BannerPlugin) { chain - .plugin(CHAIN_ID.PLUGIN.BANNER) + .plugin('garfish-banner') .use(bundler.BannerPlugin, [{ banner: 'Micro front-end' }]); } // eslint-disable-next-line react-hooks/rules-of-hooks diff --git a/packages/runtime/plugin-testing/package.json b/packages/runtime/plugin-testing/package.json index acb1ce575bb2..b43deaab73dc 100644 --- a/packages/runtime/plugin-testing/package.json +++ b/packages/runtime/plugin-testing/package.json @@ -128,7 +128,7 @@ "@modern-js/plugin": "workspace:*", "@modern-js/prod-server": "workspace:*", "@modern-js/types": "workspace:*", - "@rsbuild/babel-preset": "0.3.7", + "@rsbuild/babel-preset": "0.4.0", "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^13.4.0", "@types/testing-library__jest-dom": "^5.14.3", diff --git a/packages/server/core/src/plugin.ts b/packages/server/core/src/plugin.ts index e122d1825bfb..35fbb86ee31a 100644 --- a/packages/server/core/src/plugin.ts +++ b/packages/server/core/src/plugin.ts @@ -125,6 +125,11 @@ const extendContext = createAsyncPipeline< const handleError = createParallelWorkflow<{ error: Error }>(); +const handleSSRFallback = createParallelWorkflow<{ + ctx: ModernServerContext; + type: 'query' | 'error' | 'header'; +}>(); + export type RequestResult = { isfinish: boolean }; const beforeMatch = createAsyncPipeline< { context: ModernServerContext }, @@ -212,6 +217,7 @@ const serverHooks = { extendSSRContext, extendContext, handleError, + handleSSRFallback, beforeMatch, afterMatch, prefetch, diff --git a/packages/server/prod-server/src/libs/render/index.ts b/packages/server/prod-server/src/libs/render/index.ts index d64a6f248858..5df46bb512d1 100644 --- a/packages/server/prod-server/src/libs/render/index.ts +++ b/packages/server/prod-server/src/libs/render/index.ts @@ -76,8 +76,9 @@ export const createRenderHandler: CreateRenderHandler = ({ } // handles ssr first - const useCSR = - forceCSR && (ctx.query.csr || ctx.headers[calcFallback(metaName)]); + const queryCSR = ctx.query.csr; + const headerFallback = ctx.headers[calcFallback(metaName)]; + const useCSR = forceCSR && (queryCSR || headerFallback); if (route.isSSR && !useCSR) { try { const userAgent = ctx.getReqHeader('User-Agent') as string | undefined; @@ -118,7 +119,11 @@ export const createRenderHandler: CreateRenderHandler = ({ (err as Error).stack || (err as Error).message, ); ctx.res.set(calcFallback(metaName), '1'); + await runner.handleSSRFallback({ ctx, type: 'error' }); } + } else if (route.isSSR && useCSR) { + const fallbackType: 'query' | 'header' = queryCSR ? 'query' : 'header'; + await runner.handleSSRFallback({ ctx, type: fallbackType }); } return { diff --git a/packages/server/prod-server/tests/render.test.ts b/packages/server/prod-server/tests/render.test.ts index 44a92b97baf7..19e094abd0b2 100644 --- a/packages/server/prod-server/tests/render.test.ts +++ b/packages/server/prod-server/tests/render.test.ts @@ -31,6 +31,9 @@ describe('test render function', () => { extendSSRContext: () => { // empty }, + handleSSRFallback: () => { + // empty + }, } as any, ); @@ -121,6 +124,9 @@ describe('test render function', () => { extendSSRContext: () => { // empty }, + handleSSRFallback: () => { + // empty + }, } as any, }); expect(renderResult!.content).toMatch('Modern.js'); @@ -166,6 +172,9 @@ describe('test render function', () => { extendSSRContext: () => { // empty }, + handleSSRFallback: () => { + // empty + }, } as any, }); expect(renderResult!.content.toString()).toMatch('csr'); @@ -209,6 +218,9 @@ describe('test render function', () => { extendSSRContext: () => { // empty }, + handleSSRFallback: () => { + // empty + }, } as any, }); expect(renderResult!.content.toString()).toMatch('csr'); diff --git a/packages/server/server/package.json b/packages/server/server/package.json index 9d0547f83f37..a67363636d6a 100644 --- a/packages/server/server/package.json +++ b/packages/server/server/package.json @@ -62,7 +62,7 @@ "axios": "^1.6.0" }, "devDependencies": { - "@rsbuild/shared": "0.3.7", + "@rsbuild/shared": "0.4.0", "@modern-js/server-core": "workspace:*", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", diff --git a/packages/server/utils/package.json b/packages/server/utils/package.json index f4da87308957..19566d770e1a 100644 --- a/packages/server/utils/package.json +++ b/packages/server/utils/package.json @@ -46,7 +46,7 @@ "@modern-js/babel-compiler": "workspace:*", "@modern-js/utils": "workspace:*", "@modern-js/babel-plugin-module-resolver": "workspace:*", - "@rsbuild/babel-preset": "0.3.7", + "@rsbuild/babel-preset": "0.4.0", "@swc/helpers": "0.5.3", "babel-plugin-transform-typescript-metadata": "^0.3.2" }, diff --git a/packages/solutions/app-tools/package.json b/packages/solutions/app-tools/package.json index 43c9d65170a5..33faecf1b1da 100644 --- a/packages/solutions/app-tools/package.json +++ b/packages/solutions/app-tools/package.json @@ -90,16 +90,16 @@ "@modern-js/types": "workspace:*", "@modern-js/upgrade": "workspace:*", "@modern-js/utils": "workspace:*", - "@rsbuild/plugin-esbuild": "0.3.7", - "@rsbuild/plugin-node-polyfill": "0.3.7", - "@rsbuild/shared": "0.3.7", + "@rsbuild/plugin-esbuild": "0.4.0", + "@rsbuild/plugin-node-polyfill": "0.4.0", + "@rsbuild/shared": "0.4.0", "es-module-lexer": "^1.1.0", "esbuild": "0.17.19", "@swc/helpers": "0.5.3", "@modern-js/server-core": "workspace:*" }, "devDependencies": { - "@rsbuild/plugin-swc": "0.3.7", + "@rsbuild/plugin-swc": "0.4.0", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/babel__traverse": "7.18.5", diff --git a/packages/solutions/app-tools/src/builder/shared/builderPlugins/adapterSSR.ts b/packages/solutions/app-tools/src/builder/shared/builderPlugins/adapterSSR.ts index 6a18e4e66cca..f297c35ff16c 100644 --- a/packages/solutions/app-tools/src/builder/shared/builderPlugins/adapterSSR.ts +++ b/packages/solutions/app-tools/src/builder/shared/builderPlugins/adapterSSR.ts @@ -1,6 +1,5 @@ import * as path from 'path'; import { - ChainIdentifier, isHtmlDisabled, RsbuildPlugin, BundlerChain, @@ -39,7 +38,7 @@ export const builderPluginAdapterSSR = ( api.modifyBundlerChain( async ( chain, - { target, CHAIN_ID, isProd, HtmlPlugin: HtmlBundlerPlugin, isServer }, + { target, isProd, HtmlPlugin: HtmlBundlerPlugin, isServer }, ) => { const builderConfig = api.getNormalizedConfig(); const { normalizedConfig } = options; @@ -62,7 +61,6 @@ export const builderPluginAdapterSSR = ( applyAsyncChunkHtmlPlugin({ chain, modernConfig: options.normalizedConfig, - CHAIN_ID, HtmlBundlerPlugin, }); } @@ -97,17 +95,15 @@ const isStreamingSSR = (userConfig: AppNormalizedConfig<'shared'>): boolean => { function applyAsyncChunkHtmlPlugin({ chain, modernConfig, - CHAIN_ID, HtmlBundlerPlugin, }: { chain: BundlerChain; modernConfig: AppNormalizedConfig<'shared'>; - CHAIN_ID: ChainIdentifier; HtmlBundlerPlugin: any; }) { if (isStreamingSSR(modernConfig)) { chain - .plugin(CHAIN_ID.PLUGIN.HTML_ASYNC_CHUNK) + .plugin('html-async-chunk') .use(HtmlAsyncChunkPlugin, [HtmlBundlerPlugin]); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 37a6f33dce05..e9d88e309cd4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,8 +91,8 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rsbuild/monorepo-utils': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3) '@svgr/webpack': specifier: 8.1.0 version: 8.1.0(typescript@5.3.3) @@ -331,8 +331,8 @@ importers: specifier: 0.5.10 version: 0.5.10(react-refresh@0.14.0)(webpack@5.89.0) '@rsbuild/babel-preset': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0 '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -649,56 +649,56 @@ importers: specifier: 0.5.10 version: 0.5.10(react-refresh@0.14.0)(webpack@5.89.0) '@rsbuild/babel-preset': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0 '@rsbuild/core': - specifier: 0.3.7 - version: 0.3.7 + specifier: 0.4.0 + version: 0.4.0 '@rsbuild/plugin-assets-retry': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-babel': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-check-syntax': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-css-minimizer': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(esbuild@0.17.19)(webpack@5.89.0) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(esbuild@0.17.19)(webpack@5.89.0) '@rsbuild/plugin-pug': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-react': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-rem': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-source-build': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-styled-components': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-svgr': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(typescript@5.3.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(typescript@5.3.3) '@rsbuild/plugin-toml': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-type-check': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(typescript@5.3.3)(webpack@5.89.0) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(typescript@5.3.3)(webpack@5.89.0) '@rsbuild/plugin-yaml': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/shared': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3) '@rsbuild/webpack': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3)(esbuild@0.17.19) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3)(esbuild@0.17.19) '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -729,6 +729,9 @@ importers: postcss-custom-properties: specifier: 13.1.5 version: 13.1.5(postcss@8.4.31) + postcss-flexbugs-fixes: + specifier: 5.0.2 + version: 5.0.2(postcss@8.4.31) postcss-font-variant: specifier: 5.0.0 version: 5.0.0(postcss@8.4.31) @@ -767,8 +770,8 @@ importers: specifier: workspace:* version: link:../plugin-node-polyfill '@rsbuild/plugin-swc': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0) '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -1244,8 +1247,8 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rsbuild/plugin-swc': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0) '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -1378,8 +1381,8 @@ importers: specifier: ^2.0.0 version: 2.0.0(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) '@rsbuild/core': - specifier: 0.3.7 - version: 0.3.7 + specifier: 0.4.0 + version: 0.4.0 '@scripts/jest-config': specifier: workspace:* version: link:../../../scripts/jest-config @@ -1647,8 +1650,8 @@ importers: specifier: workspace:* version: link:../../review/tsconfig '@rspress/shared': - specifier: 1.11.1 - version: 1.11.1 + specifier: 1.11.2 + version: 1.11.2 '@types/node': specifier: ^14 version: 14.18.35 @@ -1659,8 +1662,8 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) rspress: - specifier: 1.11.1 - version: 1.11.1(typescript@5.3.3)(webpack@5.89.0) + specifier: 1.11.2 + version: 1.11.2(typescript@5.3.3)(webpack@5.89.0) packages/document/main-doc: dependencies: @@ -1675,8 +1678,8 @@ importers: specifier: workspace:* version: link:../../cli/doc-plugin-auto-sidebar '@rspress/shared': - specifier: 1.11.1 - version: 1.11.1 + specifier: 1.11.2 + version: 1.11.2 '@types/fs-extra': specifier: 9.0.13 version: 9.0.13 @@ -1699,8 +1702,8 @@ importers: specifier: ^18 version: 18.2.0(react@18.2.0) rspress: - specifier: 1.11.1 - version: 1.11.1(typescript@5.3.3)(webpack@5.89.0) + specifier: 1.11.2 + version: 1.11.2(typescript@5.3.3)(webpack@5.89.0) ts-node: specifier: ^10.9.1 version: 10.9.2(@types/node@16.11.68)(typescript@5.3.3) @@ -1714,8 +1717,8 @@ importers: specifier: workspace:* version: link:../../cli/doc-plugin-auto-sidebar '@rspress/shared': - specifier: 1.11.1 - version: 1.11.1 + specifier: 1.11.2 + version: 1.11.2 react: specifier: ^18.2.0 version: 18.2.0 @@ -1723,8 +1726,8 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) rspress: - specifier: 1.11.1 - version: 1.11.1(typescript@5.3.3)(webpack@5.89.0) + specifier: 1.11.2 + version: 1.11.2(typescript@5.3.3)(webpack@5.89.0) packages/generator/generator-cases: dependencies: @@ -3274,8 +3277,8 @@ importers: specifier: ^7.22.10 version: 7.22.10(@babel/eslint-parser@7.22.15)(eslint@8.28.0) '@rsbuild/babel-preset': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0 '@typescript-eslint/eslint-plugin': specifier: ^5.59.0 version: 5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.28.0)(typescript@5.3.3) @@ -3685,8 +3688,8 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rsbuild/babel-preset': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0 '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -4448,8 +4451,8 @@ importers: specifier: workspace:* version: link:../core '@rsbuild/shared': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3) '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -4520,8 +4523,8 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rsbuild/babel-preset': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0 '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -4614,14 +4617,14 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rsbuild/plugin-esbuild': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/plugin-node-polyfill': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) '@rsbuild/shared': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3) '@swc/helpers': specifier: 0.5.3 version: 0.5.3 @@ -4633,8 +4636,8 @@ importers: version: 0.17.19 devDependencies: '@rsbuild/plugin-swc': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0) '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -5962,11 +5965,11 @@ importers: specifier: 1.33.0 version: 1.33.0 '@rsbuild/plugin-swc': - specifier: 0.3.7 - version: 0.3.7(@rsbuild/core@0.3.7) + specifier: 0.4.0 + version: 0.4.0(@rsbuild/core@0.4.0) '@rsbuild/shared': - specifier: 0.3.7 - version: 0.3.7(@swc/helpers@0.5.3) + specifier: 0.4.0 + version: 0.4.0(@swc/helpers@0.5.3) '@types/lodash': specifier: ^4.14.202 version: 4.14.202 @@ -14274,8 +14277,8 @@ packages: rollup: 3.29.4 dev: true - /@rsbuild/babel-preset@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-GeKUdQRZFNzfoRw0tDRyabtKsgj3SXP0tqE/2spmedUriP8W6m5ywbaWwsyiBV6VU/fMljnvk4xlGzcdSfDGgg==} + /@rsbuild/babel-preset@0.4.0: + resolution: {integrity: sha512-e0LuLKXx5X5OiUgeIgEPiFtW/c+vV+eFkj9GJ88mGIQe210Y+K8OmHrYcJ3zrVN9LH12adOtRqNLiUTFXukROw==} dependencies: '@babel/core': 7.23.6 '@babel/plugin-proposal-decorators': 7.23.6(@babel/core@7.23.6) @@ -14287,72 +14290,56 @@ packages: '@babel/preset-typescript': 7.23.2(@babel/core@7.23.6) '@babel/runtime': 7.23.2 '@babel/types': 7.23.6 - '@rsbuild/plugin-babel': 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) '@types/babel__core': 7.20.3 babel-plugin-dynamic-import-node: 2.3.3 core-js: 3.32.2 transitivePeerDependencies: - - '@rsbuild/core' - - '@swc/helpers' - supports-color dev: false - /@rsbuild/core@0.3.1: - resolution: {integrity: sha512-YrE9mPG1/NmUm9oEVCfSD1NS0wiLUqrfh9b26hXjdSLa5SkPJCpjkTY6ukSyJe+AhT7jmOWTNAAk/X2tD1FwIg==} + /@rsbuild/core@0.4.0: + resolution: {integrity: sha512-AHz7yMsR0OAsrU3Mqbx0dsBTspV+95ZXaOjjCJYFENSrXnftfcvWy+SOsyKgvz6gHIeOraNKXFuYwXSdd+ImuA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: - '@rsbuild/shared': 0.3.1(@swc/helpers@0.5.3) - '@rspack/core': 0.5.0(@swc/helpers@0.5.3) - '@swc/helpers': 0.5.3 - core-js: 3.32.2 - html-webpack-plugin: /html-rspack-plugin@5.5.7 - postcss: 8.4.31 - dev: true - - /@rsbuild/core@0.3.7: - resolution: {integrity: sha512-3CECaT33x0m+tnnvdSMmNkRUn5D0hrd2lSBklmyBKwTASKT8xlhHNWOTFbrOlG4PByjPRCO4PoykZa5OOVvXMA==} - engines: {node: '>=14.0.0'} - hasBin: true - dependencies: - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) - '@rspack/core': 0.5.0(@swc/helpers@0.5.3) + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) + '@rspack/core': 0.5.3(@swc/helpers@0.5.3) '@swc/helpers': 0.5.3 core-js: 3.32.2 html-webpack-plugin: /html-rspack-plugin@5.5.7 postcss: 8.4.33 - /@rsbuild/monorepo-utils@0.3.7(@swc/helpers@0.5.3): - resolution: {integrity: sha512-sLsvvHTbAf3eaYR8wpc+88s0a13RR+WTa2SEML2BS1865BoHpkaURIDaVbLfIO3FWR6uap8WV5Eazl5fxwb3yQ==} + /@rsbuild/monorepo-utils@0.4.0(@swc/helpers@0.5.3): + resolution: {integrity: sha512-IgkKuqMHWAex75OjPG+v1YMiRFbKmbbjIQeE4T03Z1+1U7XTEKEbVOTytCAbKKinUx7YV8nDR17qatDU0TjEIA==} dependencies: - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) fast-glob: 3.3.2 transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-assets-retry@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-7Gpj6m18XQf+8BdLF0s5QD7DLYyLac8j1EuOzktSjL+UNFmTBrvkP3csEPSFcr2/n28YbC3CR31ZUVhtBwy0YA==} + /@rsbuild/plugin-assets-retry@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-dDPtaIn9+YFcZh5NYBIkQXhZXuxACcYT+S/Y8qsmWoYa3C9EK0qlBgv38jj7lBgzKyL++hURnh9ntgpJmR2StA==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) serialize-javascript: 6.0.1 transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-babel@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-L4ORUCTmy3rv5elWrG04EyaOYea24BnRn5jp9aA0zHgraFVf/YAk430Cxa2qX7G8pWZtAHHRGE06ey3b1eCwBA==} + /@rsbuild/plugin-babel@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-7/3PCFJ463LcaLtkYpAPhDeZtKSXwjKSpB2eZ398GI5LPFwq489CFoLi8USR9qixYrx9mwr50ZafgB4wCxAWTA==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: '@babel/core': 7.23.6 + '@babel/plugin-proposal-decorators': 7.23.6(@babel/core@7.23.6) '@babel/preset-typescript': 7.23.2(@babel/core@7.23.6) - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) '@types/babel__core': 7.20.3 upath: 2.0.1 transitivePeerDependencies: @@ -14360,28 +14347,28 @@ packages: - supports-color dev: false - /@rsbuild/plugin-check-syntax@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-jh6b4zU0TjbYb/+n3Hco3rj61kEJ46qyOC3zQo06SO3hqQp6K+mwYAHZC48vWxWarYxknJw6YRk+ndEziW5doQ==} + /@rsbuild/plugin-check-syntax@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-omO3KYs3bjM2LfVTdgzNWx2SgKR+BQRxt1G0PRUxbxlhtSQ50cIzNyxQeW18dTKv6/6hiqqtxNsroJeLmY8AUA==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) acorn: 8.11.2 - caniuse-lite: 1.0.30001566 + caniuse-lite: 1.0.30001584 htmlparser2: 9.1.0 source-map: 0.7.4 transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-css-minimizer@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(esbuild@0.17.19)(webpack@5.89.0): - resolution: {integrity: sha512-vbc6h3QppxJFBhbDQ9UQ6IT4ilO0kixsIgVUh+xdcHPvnDeA2hGre6Df4sd5ijTdEvnT2mddS4/w/4uYLMsp3w==} + /@rsbuild/plugin-css-minimizer@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(esbuild@0.17.19)(webpack@5.89.0): + resolution: {integrity: sha512-TYyVTuDnpcKWj2d1gTz2PnX3LEuftXlQilwe+bavDyxAJ/U1uF1Jg9Cn4NMdVc3LHKEzK/6MR5nFPorDX8kH1g==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) css-minimizer-webpack-plugin: 5.0.1(esbuild@0.17.19)(webpack@5.89.0) transitivePeerDependencies: - '@parcel/css' @@ -14394,13 +14381,13 @@ packages: - webpack dev: false - /@rsbuild/plugin-esbuild@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-hQE/Dzp6WV58yCIU/BvjBoZpFMFwZ1kE22BpgHM1vvzv2DT0g++3vyUUoucsLWbsJpxluWnt1wS1sj5h+/dx6g==} + /@rsbuild/plugin-esbuild@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-d88fV5wVKqVb7UBGLn4Yq2GzLV9jbkrsPY+Tdv8CkJoTCTJ0QOZgoswdanBIVQAVl5Yk5rTuLfYfLvRlxbtNsQ==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) esbuild: 0.17.19 webpack: 5.89.0(esbuild@0.17.19) transitivePeerDependencies: @@ -14410,13 +14397,13 @@ packages: - webpack-cli dev: false - /@rsbuild/plugin-node-polyfill@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-duck7P6dJPCIiTzzSekieA26skDX5//ECy3UAkZNis78Qh13Wr2+DEHiQ5BrFyptssuDCtjoA5x+791BU5N51Q==} + /@rsbuild/plugin-node-polyfill@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-UIEhU4fi2GOYTeMURxhI0/32mk5ekPitUngnVeDnOzs72R3zd1+xSAOFgDYdIka4CVW1idUK+gCkSUhk1SRw6w==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) assert: 2.1.0 browserify-zlib: 0.2.0 buffer: 5.7.1 @@ -14444,97 +14431,74 @@ packages: - '@swc/helpers' dev: false - /@rsbuild/plugin-pug@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-58r6gLsWN6SNqSV8+BpqDsOVn9LO0Vq51XMO4Q/ruSLJBdJEAw/o86XA4Ua36nKFJ7mn7rwxQewEbjd65dL1uQ==} + /@rsbuild/plugin-pug@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-pbaMeB42aAtmwaGoIFfVk3C+KZ61RMC4e1EHC1dy+Ady3QB+2yExunSfEYz9ovbBDxE0dpKc0vUA0GGhYnDTWQ==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) '@types/pug': 2.0.10 pug: 3.0.2 transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-react@0.3.1: - resolution: {integrity: sha512-mHkJKIBpXqnlIXg1HWMkZ6LwfQtiqbTTRN8Ag9VlLlDq3AIQLWoiGOAg1PklUon+pdFHQu8/0WG4Yybf3ISMKA==} - dependencies: - '@rsbuild/shared': 0.3.1(@swc/helpers@0.5.3) - '@rspack/plugin-react-refresh': 0.5.0(react-refresh@0.14.0) - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@swc/helpers' - dev: true - - /@rsbuild/plugin-react@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-vKjVMZBHp1EEodVsPW5E9cOaA7UvnXxK7ACjWRvuRlMK54VUkYE/npzB2QAxXU3bKK2KiYOH78YYpiHyz1mkFQ==} + /@rsbuild/plugin-react@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-zbvNBLRynsL8u3rORHKU92bSPTb4BsTuX20qJyTV9fQ0OsO8T1PvnQoHkKLVNIrCZdiC8AZc3NU2UqbHzUIY7w==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) - '@rspack/plugin-react-refresh': 0.5.0(react-refresh@0.14.0) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) + '@rspack/plugin-react-refresh': 0.5.3(react-refresh@0.14.0) react-refresh: 0.14.0 transitivePeerDependencies: - '@swc/helpers' - /@rsbuild/plugin-rem@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-72QsjLpDaIN4lA4KlgNVy9KLL1wvFEp9CNl69qtYmJLhFqSMlVBM8a+NEditw4gAokmYBL0abgxqkbEZd+pa2A==} + /@rsbuild/plugin-rem@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-0/9PxlPlXWnEKCQd/yEk/3T/W58Lx1Gv7m1IQDj/Ykp5JqE59FbbdMRlZ6qQTlWgJvr1MCNGmsKgot4dOPvTgw==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) terser: 5.27.0 transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-source-build@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-WtKgwDjpoxzSyuhwiVao86d/L9mDILfLXmNPQ4pHC3ZlJAwCMpQImyG3mfGR18q+V7svdUpdht8E58JcAeeA6A==} + /@rsbuild/plugin-source-build@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-eLnPqK7HRkbBrEE8SzzvoRrLp634o+kt0X3l/J/Axl8lLRcSR8dPFwP+X8EhphduRmitlxIHwLVHpYu1gkiCYQ==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/monorepo-utils': 0.3.7(@swc/helpers@0.5.3) - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/monorepo-utils': 0.4.0(@swc/helpers@0.5.3) + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-styled-components@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-HTdiTdHbkC7LOqZDoxpy0UhOWDUX72fYlse+AnaRUKEl+v95XnJaXKjbbFuhF6GKsXzKp/TlEkvoePTO1mz4qw==} + /@rsbuild/plugin-styled-components@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-N4oxdriEV8LaMkG8++ub3B1aZCA4T+5EJsC7C31l/uSkk2q4VYzLyCwvNjwWe6jX9evxaoi64VQSlgjFP1+sNg==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-svgr@0.3.1(typescript@5.3.3): - resolution: {integrity: sha512-uzlfrymQmIXMmZ8PL4OaY83V8TNDSohh+hfGElcbgVSLBZ11+lZ9weQUv/rQqX0sCjQgc9xIt+4w3DEnuus7Yg==} - dependencies: - '@rsbuild/shared': 0.3.1(@swc/helpers@0.5.3) - '@svgr/core': 8.1.0(typescript@5.3.3) - '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0) - '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0)(typescript@5.3.3) - transitivePeerDependencies: - - '@swc/helpers' - - supports-color - - typescript - dev: true - - /@rsbuild/plugin-svgr@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(typescript@5.3.3): - resolution: {integrity: sha512-35jIEhV8uWRUmPEIsZn86fkjLrD3eCKniiij0ZpES8+1fC4zpXxz0b60S0S8zNhkVM+K3RtuFYYIyG6xv+hPCQ==} + /@rsbuild/plugin-svgr@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(typescript@5.3.3): + resolution: {integrity: sha512-4LxjnzHNnXk3fz4Y5U+QmVY26KX7f8W8n8Pauxw1RHev5Xq9qBwRSPjs10IfA0gyy7xBKocA/O8kON8AeCbkyw==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/plugin-react': 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/plugin-react': 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) '@svgr/core': 8.1.0(typescript@5.3.3) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0) '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0)(typescript@5.3.3) @@ -14542,39 +14506,38 @@ packages: - '@swc/helpers' - supports-color - typescript - dev: false - /@rsbuild/plugin-swc@0.3.7(@rsbuild/core@0.3.7): - resolution: {integrity: sha512-i7TNGlwXE0EVwekxcgoMadsejI6hEwoQM86DumsnBhaJ+/KYDmYl1wfH6X16XB0NnVNFG0nj4O3dPJATz9lz8Q==} + /@rsbuild/plugin-swc@0.4.0(@rsbuild/core@0.4.0): + resolution: {integrity: sha512-ENT7d+FJltbrPuVkLkIjS+o00ayZIZj6TII+2RNH2V4vhTfKk3VSxPrJclxs1iTCQS3htMlJ9kBCdXitCPPC2g==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: '@modern-js/swc-plugins': 0.6.6(@swc/helpers@0.5.3) - '@rsbuild/core': 0.3.7 - '@rsbuild/plugin-react': 0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3) - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/plugin-react': 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) '@swc/helpers': 0.5.3 core-js: 3.32.2 lodash: 4.17.21 - /@rsbuild/plugin-toml@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-/aCYF2GkBeChvzt0ydsZ4+v1t0TQhOqi8kdu0M0SB+QtOH00qnE2uCkrD44XKgYO9fxpAYW06yJLTGq+gXYoxw==} + /@rsbuild/plugin-toml@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-sNJQySxYVJN+/c0aFCaVR6/SYdaOvkj03QmSBj4sd1i+BRFUmy9vZNEGJg1M9q+qBomqYzf6gc4mOwf5BeI2Og==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/plugin-type-check@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3)(typescript@5.3.3)(webpack@5.89.0): - resolution: {integrity: sha512-8KPu56GTVTuyk9zz7xj23wmTqDltfRzRbhOrV8thaXicLGNd+uVd2Xf453pPnSp6xCNElXM7fU7gpY44HmJu6g==} + /@rsbuild/plugin-type-check@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(typescript@5.3.3)(webpack@5.89.0): + resolution: {integrity: sha512-sLg3eMkKtqDWNlhxlPPFGWzqAARClPmpRkoNbWzAe0nx29X1PX9lxKBquM5M3TgSCP6yz3OiSVM/1uS3qWhBsQ==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.89.0) transitivePeerDependencies: - '@swc/helpers' @@ -14582,47 +14545,35 @@ packages: - webpack dev: false - /@rsbuild/plugin-yaml@0.3.7(@rsbuild/core@0.3.7)(@swc/helpers@0.5.3): - resolution: {integrity: sha512-/2BL0OfqLhzA6j0Wrowq/4lTXLyBTUHl/C4tkBKj58IV3V85zvfso6KDJa6put0lFH8wLFOMI+00UzrNo71ulA==} + /@rsbuild/plugin-yaml@0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3): + resolution: {integrity: sha512-IJeU+uWMj3Ghtf9uj+HxJ7UC3wPmK+oon58X7oZY6h9sb5DzTqHDf5ngjlFb+4OGp0ngcqZYU8yUWHkhOuPfsQ==} peerDependencies: - '@rsbuild/core': ^0.3.7 + '@rsbuild/core': ^0.4.0 dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) transitivePeerDependencies: - '@swc/helpers' dev: false - /@rsbuild/shared@0.3.1(@swc/helpers@0.5.3): - resolution: {integrity: sha512-KXU9kYRUcZJx37qojQmmmy5XZEplPerITvWe5SU3vKUiTV2QymO+J4gIXYUF+XFyb+OyfdJkCDcSew6EyrLwWg==} + /@rsbuild/shared@0.4.0(@swc/helpers@0.5.3): + resolution: {integrity: sha512-TlElZikaX7GhnP1VtnjPuwpgOHmi+06dNk7mZLfPIEB0ksrKewCSedTFxktEa43rGrrGUz6oBAjuxWO8j/ytCA==} dependencies: - '@rspack/core': 0.5.0(@swc/helpers@0.5.3) - caniuse-lite: 1.0.30001566 - lodash: 4.17.21 - postcss: 8.4.31 - transitivePeerDependencies: - - '@swc/helpers' - dev: true - - /@rsbuild/shared@0.3.7(@swc/helpers@0.5.3): - resolution: {integrity: sha512-XY82H5CzymyuUC3zGxTWDgKEXWXiQnt1kmPQS1T1mS6jwo8SSwTcEub+E5vtpAOn6r1tNGGHZre+7EVJtF51nQ==} - dependencies: - '@rspack/core': 0.5.0(@swc/helpers@0.5.3) - caniuse-lite: 1.0.30001566 - lodash: 4.17.21 + '@rspack/core': 0.5.3(@swc/helpers@0.5.3) + caniuse-lite: 1.0.30001584 postcss: 8.4.33 transitivePeerDependencies: - '@swc/helpers' - /@rsbuild/webpack@0.3.7(@swc/helpers@0.5.3)(esbuild@0.17.19): - resolution: {integrity: sha512-GP/HSftBrxPI0l3VVZ8ZudD7oUgD8iL0PRtLbowy3fkSm9Ym9z86KuUHMKNqjBNXyigWdCVj2wbjRLULynlOzg==} + /@rsbuild/webpack@0.4.0(@swc/helpers@0.5.3)(esbuild@0.17.19): + resolution: {integrity: sha512-d8yssaplF2P0GUMPmVUFrdMvRjP/nu8JoQS+/US88uowy3oWLtnINI1sCb8aFjx8d6hh4UiwHTfWf9kv/+69hg==} dependencies: - '@rsbuild/core': 0.3.7 - '@rsbuild/shared': 0.3.7(@swc/helpers@0.5.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/shared': 0.4.0(@swc/helpers@0.5.3) fast-glob: 3.3.2 globby: 11.1.0 html-webpack-plugin: /html-rspack-plugin@5.5.7 - mini-css-extract-plugin: 2.7.7(webpack@5.89.0) + mini-css-extract-plugin: 2.8.0(webpack@5.89.0) postcss: 8.4.33 terser-webpack-plugin: 5.3.10(esbuild@0.17.19)(webpack@5.89.0) tsconfig-paths-webpack-plugin: 4.1.0 @@ -14689,19 +14640,19 @@ packages: dev: false optional: true - /@rspack/binding-darwin-arm64@0.5.0: - resolution: {integrity: sha512-zRx4efhn2eCjdhHt6avhdkKur6FZvYy1TgPhNKpWbTg7fnrvtNGzcVQCAOnPUUPkJjnss3veOhZlWJ3paX0EDQ==} + /@rspack/binding-darwin-arm64@0.5.1: + resolution: {integrity: sha512-Kc0b94ZN1ecUu2Gyj20kGLWzOrdJbeN1JUTMKZx6jlLa3m7uJ+FhRjnsqFmZ5kdK2zx722ejoKr7xkrl7hOkuw==} cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true - /@rspack/binding-darwin-arm64@0.5.1: - resolution: {integrity: sha512-Kc0b94ZN1ecUu2Gyj20kGLWzOrdJbeN1JUTMKZx6jlLa3m7uJ+FhRjnsqFmZ5kdK2zx722ejoKr7xkrl7hOkuw==} + /@rspack/binding-darwin-arm64@0.5.3: + resolution: {integrity: sha512-IgGpPtPwwlWkViTbrGBhywohXoGXwMZGZLPLR3tRZY4oPuSo41cwkPAhf2TZtBIfHGbITrmewsck853A4g7poA==} cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@rspack/binding-darwin-x64@0.4.5: @@ -14712,19 +14663,19 @@ packages: dev: false optional: true - /@rspack/binding-darwin-x64@0.5.0: - resolution: {integrity: sha512-d6SvBURfKow3WcKxTrjJPBkp+NLsuCPoIMaS8/bM4gHwgjVs2zuOsTQ9+l36dypOkjnu6QLkOIykTdiUKJ0eQg==} + /@rspack/binding-darwin-x64@0.5.1: + resolution: {integrity: sha512-iqt+3gKLBwXDsscOrwWTRrr4bTjKvNlOUIeuCIEgpvyvsq/Ez7mZl1hDpPhgqIih2X34zgFdiXuo31IsbXQWGQ==} cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true - /@rspack/binding-darwin-x64@0.5.1: - resolution: {integrity: sha512-iqt+3gKLBwXDsscOrwWTRrr4bTjKvNlOUIeuCIEgpvyvsq/Ez7mZl1hDpPhgqIih2X34zgFdiXuo31IsbXQWGQ==} + /@rspack/binding-darwin-x64@0.5.3: + resolution: {integrity: sha512-95lDx4+QTmuGQ3Ilo1BhM22jGHxPAMDvQzBD/4zO1cBtmXrFQuaDVRoM0hwlZDLZwGMP1sSpD5F75kWKhkOTDw==} cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@rspack/binding-linux-arm64-gnu@0.4.5: @@ -14735,19 +14686,19 @@ packages: dev: false optional: true - /@rspack/binding-linux-arm64-gnu@0.5.0: - resolution: {integrity: sha512-97xFbF7RjJc2VvX+0Hvb7Jzsk+eEE8oEUcc5Dnb7OIwGZulWKk6cLNcRkNfmL/F9kk1QEKlUTNC/VQI7ljf2tA==} + /@rspack/binding-linux-arm64-gnu@0.5.1: + resolution: {integrity: sha512-H7DV7bJat2UVTVA9BkuXTAulmY1Ysn5X7KcfIVi3Vi34C1xJja2iA7MSqozFNvkm7XrJFcTMI0trwSel9mMnNw==} cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-arm64-gnu@0.5.1: - resolution: {integrity: sha512-H7DV7bJat2UVTVA9BkuXTAulmY1Ysn5X7KcfIVi3Vi34C1xJja2iA7MSqozFNvkm7XrJFcTMI0trwSel9mMnNw==} + /@rspack/binding-linux-arm64-gnu@0.5.3: + resolution: {integrity: sha512-7ZcsDROYK01FWJ9Nv1Oso7gC3b3aP8FLzbZA7ZWFCPEuBoFmIvCIVqs6DSmmpZW3KSw+XoVMELuEJuTjDi869g==} cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rspack/binding-linux-arm64-musl@0.4.5: @@ -14758,19 +14709,19 @@ packages: dev: false optional: true - /@rspack/binding-linux-arm64-musl@0.5.0: - resolution: {integrity: sha512-lk0IomCy276EoynmksoBwg0IcHvvVXuZPMeq7OgRPTvs33mdTExSzSTPtrGzx/D00bX1ybUqLQwJhcgGt6erPQ==} + /@rspack/binding-linux-arm64-musl@0.5.1: + resolution: {integrity: sha512-iRyskxvtY5QpBrkcB3nBZaErQQRRP5ActQ0qkmhHx82PUfmGgyE9Q6ww9G+CwZuOuLpd1TFQhg80TV7e2EW1uw==} cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-arm64-musl@0.5.1: - resolution: {integrity: sha512-iRyskxvtY5QpBrkcB3nBZaErQQRRP5ActQ0qkmhHx82PUfmGgyE9Q6ww9G+CwZuOuLpd1TFQhg80TV7e2EW1uw==} + /@rspack/binding-linux-arm64-musl@0.5.3: + resolution: {integrity: sha512-IBfVGpycRrLbyCWzokzeFIfK+yII68w1WOx2iCoR+tPUKa3M7WAZjrbVB33PHxGKXeF+xX7Lzm50hi4uTK8L6g==} cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rspack/binding-linux-x64-gnu@0.4.5: @@ -14781,19 +14732,19 @@ packages: dev: false optional: true - /@rspack/binding-linux-x64-gnu@0.5.0: - resolution: {integrity: sha512-r15ddpse0S/8wHtfL85uJrVotvPVIMnQX06KlXyGUSw1jWrjxV+NXFDJ4xXnHCvk/YV6lCFTotAssk4wJEE0Fw==} + /@rspack/binding-linux-x64-gnu@0.5.1: + resolution: {integrity: sha512-P047gkIshhSDNP2HRODJlYilJ+r5rh8G86wUmZmx5tnQMqYZZZYvvH0C+pOP9F23oprwsLIrR6v/nM5U7bMIVQ==} cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-x64-gnu@0.5.1: - resolution: {integrity: sha512-P047gkIshhSDNP2HRODJlYilJ+r5rh8G86wUmZmx5tnQMqYZZZYvvH0C+pOP9F23oprwsLIrR6v/nM5U7bMIVQ==} + /@rspack/binding-linux-x64-gnu@0.5.3: + resolution: {integrity: sha512-EiVsp0yaGBmnMsS1U6Z5bitl2AjiVqFN3ArdIDZLlxgpVUHaR1ObXIkVqsX/VK5Jgytv1H7iOmtOnkOqyFmxPw==} cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rspack/binding-linux-x64-musl@0.4.5: @@ -14804,19 +14755,19 @@ packages: dev: false optional: true - /@rspack/binding-linux-x64-musl@0.5.0: - resolution: {integrity: sha512-lB9Dn1bi4xyzEe6Bf/GQ7Ktlrq4Kmt1LHwN+t0m6iVYH3Vb/3g8uQGDSkwnjP8NmlAtldK1cmvRMhR7flUrgZA==} + /@rspack/binding-linux-x64-musl@0.5.1: + resolution: {integrity: sha512-frFHfBnEjeNNtg7OBvxDeMVtahb+ZreVrXjFp8ZMBCx7Qa9+CT1K8nUzDLQZ3wVc5shikZi1Ddts6h3BathRqA==} cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-x64-musl@0.5.1: - resolution: {integrity: sha512-frFHfBnEjeNNtg7OBvxDeMVtahb+ZreVrXjFp8ZMBCx7Qa9+CT1K8nUzDLQZ3wVc5shikZi1Ddts6h3BathRqA==} + /@rspack/binding-linux-x64-musl@0.5.3: + resolution: {integrity: sha512-PZbmHZ/sFBC0W2vNNmMgeVORijAxhdkaU0QS95ltacO+bU8npcNb+01QgRzJovuhOfiT7HXDUmH7K0mrUqXpFg==} cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rspack/binding-win32-arm64-msvc@0.4.5: @@ -14827,19 +14778,19 @@ packages: dev: false optional: true - /@rspack/binding-win32-arm64-msvc@0.5.0: - resolution: {integrity: sha512-aDoF13puU8LxST/qKZndtXzlJbnbnxY2Bxyj0fu7UDh8nHJD4A2HQfWRN6BZFHaVSqM6Bnli410dJrIWeTNhZQ==} + /@rspack/binding-win32-arm64-msvc@0.5.1: + resolution: {integrity: sha512-rGDS2QIPZIYGds1GWWTIBNzvnU72CjKWKKBNQx+skFywVvs50cZ1cB78Vj4wXWzAs2hS6NPTP65mrito//hvIQ==} cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-arm64-msvc@0.5.1: - resolution: {integrity: sha512-rGDS2QIPZIYGds1GWWTIBNzvnU72CjKWKKBNQx+skFywVvs50cZ1cB78Vj4wXWzAs2hS6NPTP65mrito//hvIQ==} + /@rspack/binding-win32-arm64-msvc@0.5.3: + resolution: {integrity: sha512-bP1tgwQuTe0YSVpe73qEPXdt2rZGUpCUG3nFW+Ve27CJtq6btLqdcnnNEx2cAKs12ArN4H36U+BXfwJDp9/DaQ==} cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@rspack/binding-win32-ia32-msvc@0.4.5: @@ -14850,19 +14801,19 @@ packages: dev: false optional: true - /@rspack/binding-win32-ia32-msvc@0.5.0: - resolution: {integrity: sha512-EYGeH4YKX5v4gtTL8mBAWnsKSkF+clsKu0z1hgWgSV/vnntNlqJQZUCb5CMdg5VqadNm+lUNDYYHeHNa3+Jp3w==} + /@rspack/binding-win32-ia32-msvc@0.5.1: + resolution: {integrity: sha512-t7Cfz7V8y9DdlVd3XtUJduSXrmjst28+kqprCw9PecpOcdi0nnhmY23FjAGv7yTyhniLc4Kl3YJfk7lIHX8x9g==} cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-ia32-msvc@0.5.1: - resolution: {integrity: sha512-t7Cfz7V8y9DdlVd3XtUJduSXrmjst28+kqprCw9PecpOcdi0nnhmY23FjAGv7yTyhniLc4Kl3YJfk7lIHX8x9g==} + /@rspack/binding-win32-ia32-msvc@0.5.3: + resolution: {integrity: sha512-XKMNgkc5ScDKzt2xFQWD7ELefaEQtm9+1/7xhftDAxAC3AQELC0NqL5qAWpgSXEgVIjCW8r7xiwX5mqEEqqiuw==} cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@rspack/binding-win32-x64-msvc@0.4.5: @@ -14873,19 +14824,19 @@ packages: dev: false optional: true - /@rspack/binding-win32-x64-msvc@0.5.0: - resolution: {integrity: sha512-RCECFW6otUrFiPbWQyOvLZOMNV/OL6AyAKMDbX9ejjk0TjLMrHjnhmI5X8EoA/SUc1/vEbgsJzDVLKTfn138cg==} + /@rspack/binding-win32-x64-msvc@0.5.1: + resolution: {integrity: sha512-7ruRf8oiK9u6Klwwdtcg96A4+QaJCUBd8qQOD0wcFF77Rr0JndZxngUWAU/MUKmy3VoibzFEyk019AVhCC4cXA==} cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-x64-msvc@0.5.1: - resolution: {integrity: sha512-7ruRf8oiK9u6Klwwdtcg96A4+QaJCUBd8qQOD0wcFF77Rr0JndZxngUWAU/MUKmy3VoibzFEyk019AVhCC4cXA==} + /@rspack/binding-win32-x64-msvc@0.5.3: + resolution: {integrity: sha512-B0iosD3cTXErnlqnOawn4DqfrO2QaY135vKqBrbqTfm9Zr4ftbqvp39nL9Qot+1QuixZdYwwF/NqBvRoFd9nig==} cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@rspack/binding@0.4.5: @@ -14902,19 +14853,6 @@ packages: '@rspack/binding-win32-x64-msvc': 0.4.5 dev: false - /@rspack/binding@0.5.0: - resolution: {integrity: sha512-+v1elZMn6lKBqbXQzhcfeCaPzztFNGEkNDEcQ7weako6yQPsBihGCRzveMMzZkja4RyB9GRHjWRE+THm8V8+3w==} - optionalDependencies: - '@rspack/binding-darwin-arm64': 0.5.0 - '@rspack/binding-darwin-x64': 0.5.0 - '@rspack/binding-linux-arm64-gnu': 0.5.0 - '@rspack/binding-linux-arm64-musl': 0.5.0 - '@rspack/binding-linux-x64-gnu': 0.5.0 - '@rspack/binding-linux-x64-musl': 0.5.0 - '@rspack/binding-win32-arm64-msvc': 0.5.0 - '@rspack/binding-win32-ia32-msvc': 0.5.0 - '@rspack/binding-win32-x64-msvc': 0.5.0 - /@rspack/binding@0.5.1: resolution: {integrity: sha512-2CMZ0oVBEgs+/v2nNzIEDqKS01Al//biWl0aDclh8ypeEIM9tkI/gvhjrovsnyib9oxsO3xCM4tCNCND+nx1CA==} optionalDependencies: @@ -14929,6 +14867,19 @@ packages: '@rspack/binding-win32-x64-msvc': 0.5.1 dev: true + /@rspack/binding@0.5.3: + resolution: {integrity: sha512-bwxjp2mvSGGgVRk1D+dwilwaSEvzhQTlhe3+f2h+cjampJpEa72jle1T4bpXTOOMM0JRq06AzUWlzoMxKn+JKA==} + optionalDependencies: + '@rspack/binding-darwin-arm64': 0.5.3 + '@rspack/binding-darwin-x64': 0.5.3 + '@rspack/binding-linux-arm64-gnu': 0.5.3 + '@rspack/binding-linux-arm64-musl': 0.5.3 + '@rspack/binding-linux-x64-gnu': 0.5.3 + '@rspack/binding-linux-x64-musl': 0.5.3 + '@rspack/binding-win32-arm64-msvc': 0.5.3 + '@rspack/binding-win32-ia32-msvc': 0.5.3 + '@rspack/binding-win32-x64-msvc': 0.5.3 + /@rspack/core@0.4.5: resolution: {integrity: sha512-X29fvCqTJH9OYN5pqa2lYP9hBLGICGVugtpTIAyLtMxC7gqvjvZkG/qisaVsjPyg4p2eB0NvmosnHkRv0GJ4sg==} engines: {node: '>=16.0.0'} @@ -14951,8 +14902,8 @@ packages: zod-validation-error: 1.3.1(zod@3.22.3) dev: false - /@rspack/core@0.5.0(@swc/helpers@0.5.3): - resolution: {integrity: sha512-/Bpujdtx28qYir7AK9VVSbY35GBFEcZ1NTJZBx/WIzZGZWLCxhlVYfjH8cj44y4RvXa0Y26tnj/q7VJ4U3sHug==} + /@rspack/core@0.5.1(@swc/helpers@0.5.3): + resolution: {integrity: sha512-fsUKPhnBCV7UOE31W03GBfqp7lSRZBcRuvLwrUt1bmTAvl9SRrR0HuWhJAs4O8LvrjKgxRzXPM8Fpysqerfo4w==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -14961,7 +14912,7 @@ packages: optional: true dependencies: '@module-federation/runtime-tools': 0.0.8 - '@rspack/binding': 0.5.0 + '@rspack/binding': 0.5.1 '@swc/helpers': 0.5.3 browserslist: 4.22.2 enhanced-resolve: 5.12.0 @@ -14974,9 +14925,10 @@ packages: webpack-sources: 3.2.3 zod: 3.22.3 zod-validation-error: 1.3.1(zod@3.22.3) + dev: true - /@rspack/core@0.5.1(@swc/helpers@0.5.3): - resolution: {integrity: sha512-fsUKPhnBCV7UOE31W03GBfqp7lSRZBcRuvLwrUt1bmTAvl9SRrR0HuWhJAs4O8LvrjKgxRzXPM8Fpysqerfo4w==} + /@rspack/core@0.5.3(@swc/helpers@0.5.3): + resolution: {integrity: sha512-/WCMUCwcduSrx0za1kVoN3Fdkf/fDK3v6fgvJeeNc+l7/mGttSROUmlVidmz7eyQuD9itr947NB5U087Y99dag==} engines: {node: '>=16.0.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -14985,10 +14937,11 @@ packages: optional: true dependencies: '@module-federation/runtime-tools': 0.0.8 - '@rspack/binding': 0.5.1 + '@rspack/binding': 0.5.3 '@swc/helpers': 0.5.3 browserslist: 4.22.2 enhanced-resolve: 5.12.0 + events: 3.3.0 graceful-fs: 4.2.10 json-parse-even-better-errors: 3.0.0 neo-async: 2.6.2 @@ -14998,7 +14951,6 @@ packages: webpack-sources: 3.2.3 zod: 3.22.3 zod-validation-error: 1.3.1(zod@3.22.3) - dev: true /@rspack/plugin-html@0.4.5(@rspack/core@0.4.5): resolution: {integrity: sha512-W+m86gTwfY18Zbx/j1SHnF0qQwcvupcxn1UTCrkygVVmJhEtPXIid4DsNLMp9Igs4LBkWBeC9SU+xzF0BUkjGA==} @@ -15026,8 +14978,8 @@ packages: react-refresh: 0.14.0 dev: false - /@rspack/plugin-react-refresh@0.5.0(react-refresh@0.14.0): - resolution: {integrity: sha512-Tas91XaFgRmgdLFzgeei/LybMFvnYBicMf4Y7Yt9lZHRHfgONrGbmqSVeS+nWWTW9U8Q31K9uiM2Z2a02hq2Vw==} + /@rspack/plugin-react-refresh@0.5.3(react-refresh@0.14.0): + resolution: {integrity: sha512-YdEtvfLBpbbtqUO5cxM947FjdZhsTBR3Dp8djxGS1jPUZ+gJ0tOmNI5V3MZtDC/lsiSlnnKwOAImOUSQ9yV1Fw==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' peerDependenciesMeta: @@ -15036,8 +14988,8 @@ packages: dependencies: react-refresh: 0.14.0 - /@rspress/core@1.11.1(typescript@5.3.3)(webpack@5.89.0): - resolution: {integrity: sha512-1lY7q1fHonJYgU4LNSJfiCOZbrIGOIjdbRLgCcn1zNDAMa+LOHPqptu5SQutO+WLCuXIeb7jM8gI9MOuxTdunA==} + /@rspress/core@1.11.2(typescript@5.3.3)(webpack@5.89.0): + resolution: {integrity: sha512-EXvc/r2fgYjWZF80EtSZ1Zl1LKB7qwEKeHBO9xU5pwfjonvW+W6zgR6H5jqHFtA7MlqDDCk36zN9h27BC/uF1A==} engines: {node: '>=14.17.6'} dependencies: '@loadable/component': 5.15.2(react@18.2.0) @@ -15045,17 +14997,17 @@ packages: '@mdx-js/mdx': 2.2.1 '@mdx-js/react': 2.2.1(react@18.2.0) '@modern-js/utils': link:packages/toolkit/utils - '@rsbuild/core': 0.3.1 - '@rsbuild/plugin-react': 0.3.1 - '@rsbuild/plugin-svgr': 0.3.1(typescript@5.3.3) + '@rsbuild/core': 0.4.0 + '@rsbuild/plugin-react': 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3) + '@rsbuild/plugin-svgr': 0.4.0(@rsbuild/core@0.4.0)(@swc/helpers@0.5.3)(typescript@5.3.3) '@rspress/mdx-rs': 0.4.3 - '@rspress/plugin-auto-nav-sidebar': 1.11.1 - '@rspress/plugin-container-syntax': 1.11.1 - '@rspress/plugin-last-updated': 1.11.1 - '@rspress/plugin-medium-zoom': 1.11.1(@rspress/runtime@1.11.1) - '@rspress/runtime': 1.11.1 - '@rspress/shared': 1.11.1 - '@rspress/theme-default': 1.11.1(webpack@5.89.0) + '@rspress/plugin-auto-nav-sidebar': 1.11.2 + '@rspress/plugin-container-syntax': 1.11.2 + '@rspress/plugin-last-updated': 1.11.2 + '@rspress/plugin-medium-zoom': 1.11.2(@rspress/runtime@1.11.2) + '@rspress/runtime': 1.11.2 + '@rspress/shared': 1.11.2 + '@rspress/theme-default': 1.11.2(webpack@5.89.0) body-scroll-lock: 4.0.0-beta.0 copy-to-clipboard: 3.3.3 enhanced-resolve: 5.12.0 @@ -15194,52 +15146,52 @@ packages: '@rspress/mdx-rs-win32-x64-msvc': 0.4.3 dev: true - /@rspress/plugin-auto-nav-sidebar@1.11.1: - resolution: {integrity: sha512-6XMPbhz19sNHi7UGZbV2xeLaN9lXM65IEI6ScqVBhnU9nbSuIexe2eme1TB7L48Msr8d3Q3du9wHgopR6IyvsQ==} + /@rspress/plugin-auto-nav-sidebar@1.11.2: + resolution: {integrity: sha512-ymDmpBdRkm5yXuN1aVs6hbSHqhk9xm26WheY8KMIZWmEA5bZRkIkYj7X51Z2l5YDy6F1nSE+Es27ihiO3cpr/A==} engines: {node: '>=14.17.6'} dependencies: - '@rspress/shared': 1.11.1 + '@rspress/shared': 1.11.2 dev: true - /@rspress/plugin-container-syntax@1.11.1: - resolution: {integrity: sha512-n4k2Xtojn3hHpWbAEUmy0n6Ph8Cn55BbZu+2DgA5XrhozDlRZLXE2QWkrcGpdvI0Ux3uixHTTFB8hrp3AaKKBQ==} + /@rspress/plugin-container-syntax@1.11.2: + resolution: {integrity: sha512-mOTR3sscp/pTpiImIp2ZvsU0/oWgIux4r2/jGDe87q3p9PBr0v5XHKmoV8numjyroVUd8RzwOSXR5v1kpCL2vQ==} engines: {node: '>=14.17.6'} dependencies: - '@rspress/shared': 1.11.1 + '@rspress/shared': 1.11.2 dev: true - /@rspress/plugin-last-updated@1.11.1: - resolution: {integrity: sha512-AxtWdCd1+7Dw05gB9f48SyopQLg2MUOZLAN01LdQ85hJMMxbFnJJQRlIEMxWAY3U8x7i7xNw5Km1Jycpoy7Sig==} + /@rspress/plugin-last-updated@1.11.2: + resolution: {integrity: sha512-zzi8iqMoL8Q2w0apM2HGzoa4M2Hhzez9SFYHnkBZYn7ZYyyyFPZXbPgS3Oee/Ysr/UmKocT4j4b038jw2sTpkA==} engines: {node: '>=14.17.6'} dependencies: - '@rspress/shared': 1.11.1 + '@rspress/shared': 1.11.2 dev: true - /@rspress/plugin-medium-zoom@1.11.1(@rspress/runtime@1.11.1): - resolution: {integrity: sha512-IF4BZE78oppsr+jV6x1xWrj8F7bQTd3NzOPRXVSp2EZivdDmTONUJdH4sgd5e32zw7uk9g4P6bM1mN5HKrTqtA==} + /@rspress/plugin-medium-zoom@1.11.2(@rspress/runtime@1.11.2): + resolution: {integrity: sha512-XwpGEvEUlGyCFt8PBwtmed9bjbSdyFcah0RWd978YXQDcMHjuKnLLqJO131cRxyX4JWccVFn8oEru5kn+LH27g==} engines: {node: '>=14.17.6'} peerDependencies: '@rspress/runtime': ^1.0.2 dependencies: - '@rspress/runtime': 1.11.1 + '@rspress/runtime': 1.11.2 medium-zoom: 1.0.8 dev: true - /@rspress/runtime@1.11.1: - resolution: {integrity: sha512-cSYAbdJTUF7cQ1qk0zvDXYcEtev0ztTSlNVL6lX9GMsYbTk5B+/dwlUbfXDO8e+bnecG5aadWC+FDKKVrGOAqg==} + /@rspress/runtime@1.11.2: + resolution: {integrity: sha512-XodcVZtk8maiZko6RAaB5EnHxz3KQLFk2zq2TRL0kVQ4PXaUSr2WEgwLMw7Siz2h5AjQlDUOPipt4AhkLTd1sw==} engines: {node: '>=14.17.6'} dependencies: - '@rspress/shared': 1.11.1 + '@rspress/shared': 1.11.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-helmet-async: 1.3.0(react-dom@18.2.0)(react@18.2.0) react-router-dom: 6.17.0(react-dom@18.2.0)(react@18.2.0) dev: true - /@rspress/shared@1.11.1: - resolution: {integrity: sha512-kl48IDNRIDwE4aJDvf8kk6VAzGRpn+WsPpEldTYN9Ov5MkwVHL/ejZr0G2AVXR2hvbp6JgsvmLVloAWWFwpi5Q==} + /@rspress/shared@1.11.2: + resolution: {integrity: sha512-ZWLGx1jDrOYkNGHtH63bTz+9t3IMo4rWvbL+5jp3jvZxB4LaixsE6YKYintGGlY1qsnXn4BYW7aItkwRyhltgg==} dependencies: - '@rsbuild/core': 0.3.1 + '@rsbuild/core': 0.4.0 chalk: 4.1.2 execa: 5.1.1 fs-extra: 11.2.0 @@ -15247,13 +15199,13 @@ packages: unified: 10.1.2 dev: true - /@rspress/theme-default@1.11.1(webpack@5.89.0): - resolution: {integrity: sha512-L4PXzIPxltwlmhdEu3HArxtBz+5NBxU/DfwfFRwVZk7V4MHBljGauhNbORszN0jEaeVYu1mU2DphMyZVAQ+ztw==} + /@rspress/theme-default@1.11.2(webpack@5.89.0): + resolution: {integrity: sha512-jkSs2PXaowadN9cr5TEQQ2IUQehk6HyesAaYrXnikxj0VkxsMLCcTd5E6jM11tzjgan4qRZdJf1T/3zuMJp22g==} engines: {node: '>=14.17.6'} dependencies: '@mdx-js/react': 2.2.1(react@18.2.0) - '@rspress/runtime': 1.11.1 - '@rspress/shared': 1.11.1 + '@rspress/runtime': 1.11.2 + '@rspress/shared': 1.11.2 body-scroll-lock: 4.0.0-beta.0 copy-to-clipboard: 3.3.3 flexsearch: 0.6.32 @@ -18978,6 +18930,9 @@ packages: /caniuse-lite@1.0.30001566: resolution: {integrity: sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==} + /caniuse-lite@1.0.30001584: + resolution: {integrity: sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==} + /ccount@1.1.0: resolution: {integrity: sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==} dev: false @@ -26250,13 +26205,14 @@ packages: webpack: 5.89.0(esbuild@0.17.19) dev: false - /mini-css-extract-plugin@2.7.7(webpack@5.89.0): - resolution: {integrity: sha512-+0n11YGyRavUR3IlaOzJ0/4Il1avMvJ1VJfhWfCn24ITQXhRr1gghbhhrda6tgtNcpZaWKdSuwKq20Jb7fnlyw==} + /mini-css-extract-plugin@2.8.0(webpack@5.89.0): + resolution: {integrity: sha512-CxmUYPFcTgET1zImteG/LZOy/4T5rTojesQXkSNBiquhydn78tfbCE9sjIjnJ/UcjNjOC1bphTCCW5rrS7cXAg==} engines: {node: '>= 12.13.0'} peerDependencies: webpack: ^5.0.0 dependencies: schema-utils: 4.2.0 + tapable: 2.2.1 webpack: 5.89.0(esbuild@0.17.19) dev: false @@ -27515,7 +27471,6 @@ packages: postcss: ^8.1.4 dependencies: postcss: 8.4.31 - dev: true /postcss-font-variant@5.0.0(postcss@8.4.31): resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} @@ -30370,13 +30325,13 @@ packages: fs-extra: 11.2.0 dev: true - /rspress@1.11.1(typescript@5.3.3)(webpack@5.89.0): - resolution: {integrity: sha512-DqljMUuCGsdJBoPPknInPgYDQIrRQJnNeJdM9kansOl1oWjAPhYfGDKcHqDFEMBDRSqm3UW5EMsVTi6Ta6kKgQ==} + /rspress@1.11.2(typescript@5.3.3)(webpack@5.89.0): + resolution: {integrity: sha512-7vdPQbFdEjytzeGDaQi2g93c1AksgIY9W4qx/FLy+hJm1zgf+72TD36aqirIY350ehjgJFRHp9z+Ldz9e8t6Ng==} hasBin: true dependencies: '@modern-js/node-bundle-require': link:packages/toolkit/node-bundle-require - '@rspress/core': 1.11.1(typescript@5.3.3)(webpack@5.89.0) - '@rspress/shared': 1.11.1 + '@rspress/core': 1.11.2(typescript@5.3.3)(webpack@5.89.0) + '@rspress/shared': 1.11.2 cac: 6.7.14 chalk: 5.3.0 chokidar: 3.5.3 diff --git a/tests/e2e/builder/package.json b/tests/e2e/builder/package.json index de644ee6991f..bf89a066cab6 100644 --- a/tests/e2e/builder/package.json +++ b/tests/e2e/builder/package.json @@ -16,8 +16,8 @@ "vue": "^3.3.4" }, "devDependencies": { - "@rsbuild/plugin-swc": "0.3.7", - "@rsbuild/shared": "0.3.7", + "@rsbuild/plugin-swc": "0.4.0", + "@rsbuild/shared": "0.4.0", "@modern-js/uni-builder": "workspace:*", "@modern-js/e2e": "workspace:*", "@modern-js/utils": "workspace:*", diff --git a/tests/integration/source-code-build/app-ts-loader/modern.config.ts b/tests/integration/source-code-build/app-ts-loader/modern.config.ts index 95f3b2ece731..cb8f21665e79 100644 --- a/tests/integration/source-code-build/app-ts-loader/modern.config.ts +++ b/tests/integration/source-code-build/app-ts-loader/modern.config.ts @@ -9,10 +9,8 @@ export default defineConfig({ }, plugins: [ appTools({ - bundler: - process.env.PROVIDE_TYPE === 'rspack' - ? 'experimental-rspack' - : 'webpack', + // ts-loader only supports webpack + bundler: 'webpack', }), ], tools: { diff --git a/tests/integration/source-code-build/app-ts-loader/tsconfig.json b/tests/integration/source-code-build/app-ts-loader/tsconfig.json index d5983798fc41..a0c21134f237 100644 --- a/tests/integration/source-code-build/app-ts-loader/tsconfig.json +++ b/tests/integration/source-code-build/app-ts-loader/tsconfig.json @@ -2,7 +2,7 @@ "extends": "@modern-js/tsconfig/base", "compilerOptions": { "declaration": false, - "jsx": "react-jsx", + "jsx": "preserve", "baseUrl": "./", "paths": { "@/*": ["./src/*"],