@rsbuild/core 2.0.0-alpha.0 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
@@ -2,7 +2,7 @@ import * as __rspack_external__rspack_lite_tapable_c6bdf810 from "@rspack/lite-t
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
3
  import "./131.js";
4
4
  __webpack_require__.add({
5
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
5
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: !0
8
8
  }), exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
@@ -64,11 +64,11 @@ __webpack_require__.add({
64
64
  'sort'
65
65
  ].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
66
66
  },
67
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
67
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
68
68
  Object.defineProperty(exports, "__esModule", {
69
69
  value: !0
70
70
  }), exports.normalModuleLoaderHook = exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
71
- let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("@rspack/lite-tapable"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
71
+ let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("@rspack/lite-tapable"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
72
72
  let hooks = compilerHookMap.get(compiler);
73
73
  return void 0 === hooks && (hooks = {
74
74
  afterEmit: new lite_tapable_1.SyncWaterfallHook([
@@ -83,7 +83,6 @@ __webpack_require__.add({
83
83
  let emitCount = emitCountMap.get(manifestFileName) || 0;
84
84
  emitCountMap.set(manifestFileName, emitCount + 1), callback && callback();
85
85
  }, exports.emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manifestFileName, moduleAssets, options }, compilation) {
86
- var _a;
87
86
  let emitCount = emitCountMap.get(manifestFileName) - 1, stats = compilation.getStats().toJson({
88
87
  all: !1,
89
88
  assets: !0,
@@ -93,16 +92,13 @@ __webpack_require__.add({
93
92
  }), resolvedPublicPath = null !== options.publicPath ? options.publicPath : stats.publicPath, publicPath = 'auto' === resolvedPublicPath ? '' : resolvedPublicPath, { basePath, removeKeyHash } = options;
94
93
  emitCountMap.set(manifestFileName, emitCount);
95
94
  let auxiliaryFiles = {}, files = Array.from(compilation.chunks).reduce((prev, chunk)=>(0, helpers_1.reduceChunk)(prev, chunk, options, auxiliaryFiles), []);
96
- (files = (files = stats.assets.reduce((prev, asset)=>(0, helpers_1.reduceAssets)(prev, asset, moduleAssets), files)).filter(({ name, path })=>{
97
- var _a;
98
- return !path.includes('hot-update') && void 0 === emitCountMap.get((0, node_path_1.join)((null == (_a = compiler.options.output) ? void 0 : _a.path) || '<unknown>', name));
99
- })).forEach((file)=>{
95
+ (files = (files = stats.assets.reduce((prev, asset)=>(0, helpers_1.reduceAssets)(prev, asset, moduleAssets), files)).filter(({ name, path })=>!path.includes('hot-update') && void 0 === emitCountMap.get((0, node_path_1.join)(compiler.options.output?.path || '<unknown>', name)))).forEach((file)=>{
100
96
  delete auxiliaryFiles[file.path];
101
97
  }), Object.keys(auxiliaryFiles).forEach((auxiliaryFile)=>{
102
98
  files = files.concat(auxiliaryFiles[auxiliaryFile]);
103
99
  });
104
100
  let integrityMap = {};
105
- null == (_a = stats.assets) || _a.forEach((asset)=>{
101
+ stats.assets?.forEach((asset)=>{
106
102
  asset.integrity && (integrityMap[asset.name] = asset.integrity);
107
103
  }), files = files.map((file)=>{
108
104
  let normalizePath = (path)=>path.endsWith('/') ? path : `${path}/`, changes = {
@@ -126,9 +122,9 @@ __webpack_require__.add({
126
122
  }), emitFile.call(module, file, content, sourceMap));
127
123
  };
128
124
  },
129
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
125
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
130
126
  exports.RspackManifestPlugin = void 0;
131
- let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
127
+ let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
132
128
  assetHookStage: 1 / 0,
133
129
  basePath: '',
134
130
  fileName: 'manifest.json',
@@ -150,8 +146,7 @@ __webpack_require__.add({
150
146
  this.options = Object.assign({}, defaults, opts);
151
147
  }
152
148
  apply(compiler) {
153
- var _a, _b;
154
- let manifestFileName = (0, node_path_1.resolve)((null == (_a = compiler.options.output) ? void 0 : _a.path) || './', this.options.fileName), manifestAssetId = (0, node_path_1.relative)((null == (_b = compiler.options.output) ? void 0 : _b.path) || './', manifestFileName), beforeRun = hooks_1.beforeRunHook.bind(this, {
149
+ let manifestFileName = (0, node_path_1.resolve)(compiler.options.output?.path || './', this.options.fileName), manifestAssetId = (0, node_path_1.relative)(compiler.options.output?.path || './', manifestFileName), beforeRun = hooks_1.beforeRunHook.bind(this, {
155
150
  emitCountMap,
156
151
  manifestFileName
157
152
  }), emit = hooks_1.emitHook.bind(this, {
package/dist/memfs.js CHANGED
@@ -1,9 +1,8 @@
1
- import * as __rspack_external_node_events_0a6aefe7 from "node:events";
2
- import * as __rspack_external_node_stream_444d1c2b from "node:stream";
3
1
  import * as __rspack_external_process from "process";
4
2
  import { __webpack_require__ } from "./rslib-runtime.js";
5
3
  import "./131.js";
6
4
  import "./743.js";
5
+ import "./397.js";
7
6
  __webpack_require__.add({
8
7
  "../../node_modules/.pnpm/glob-to-regex.js@1.2.0_tslib@2.8.1/node_modules/glob-to-regex.js/lib/index.js" (__unused_rspack_module, exports) {
9
8
  Object.defineProperty(exports, "__esModule", {
@@ -3123,12 +3122,6 @@ __webpack_require__.add({
3123
3122
  return str;
3124
3123
  };
3125
3124
  },
3126
- "node:events" (module) {
3127
- module.exports = __rspack_external_node_events_0a6aefe7;
3128
- },
3129
- "node:stream" (module) {
3130
- module.exports = __rspack_external_node_stream_444d1c2b;
3131
- },
3132
3125
  process (module) {
3133
3126
  module.exports = __rspack_external_process;
3134
3127
  },
package/dist/open.js CHANGED
@@ -1,9 +1,9 @@
1
1
  let isDockerCached, cachedResult, canAccessPowerShellPromise, mountPoint, defaultMountPoint;
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
3
  import node_child_process, { execFile } from "node:child_process";
4
- import promises, { constants } from "node:fs/promises";
5
4
  import { node_process, node_os, external_node_util_promisify } from "./131.js";
6
5
  import "./743.js";
6
+ import { constants, promises } from "./7.js";
7
7
  let external_node_fs_ = __webpack_require__("node:fs");
8
8
  function hasDockerEnv() {
9
9
  try {
@@ -98,8 +98,6 @@ export declare const CHAIN_ID: {
98
98
  readonly LIGHTNINGCSS: "lightningcss";
99
99
  /** ignore-css-loader */
100
100
  readonly IGNORE_CSS: "ignore-css";
101
- /** css-modules-typescript-loader */
102
- readonly CSS_MODULES_TS: "css-modules-typescript";
103
101
  /** CssExtractRspackPlugin.loader */
104
102
  readonly MINI_CSS_EXTRACT: "mini-css-extract";
105
103
  /** resolve-url-loader */
@@ -117,8 +115,8 @@ export declare const CHAIN_ID: {
117
115
  readonly DEFINE: "define";
118
116
  /** ProgressPlugin */
119
117
  readonly PROGRESS: "progress";
120
- /** WebpackManifestPlugin */
121
- readonly MANIFEST: "webpack-manifest";
118
+ /** RspackManifestPlugin */
119
+ readonly MANIFEST: "rspack-manifest";
122
120
  /** ForkTsCheckerWebpackPlugin */
123
121
  readonly TS_CHECKER: "ts-checker";
124
122
  /** ModuleFederationPlugin */
@@ -143,10 +141,5 @@ export declare const CHAIN_ID: {
143
141
  /** LightningCssMinimizerRspackPlugin */
144
142
  readonly CSS: "css";
145
143
  };
146
- /** Predefined resolve plugins */
147
- readonly RESOLVE_PLUGIN: {
148
- /** TsConfigPathsPlugin */
149
- readonly TS_CONFIG_PATHS: "ts-config-paths";
150
- };
151
144
  };
152
145
  export type ChainIdentifier = typeof CHAIN_ID;
@@ -1,6 +1,5 @@
1
1
  type CompiledPackages = {
2
2
  ws: typeof import('../../compiled/ws').default;
3
- chokidar: typeof import('../../compiled/chokidar').default;
4
3
  'webpack-merge': typeof import('../../compiled/webpack-merge');
5
4
  'html-rspack-plugin': typeof import('../../compiled/html-rspack-plugin').default;
6
5
  'http-proxy-middleware': typeof import('../../compiled/http-proxy-middleware');
@@ -19,4 +19,4 @@ export { type Logger, logger } from './logger';
19
19
  export { mergeRsbuildConfig } from './mergeConfig';
20
20
  export type { RsbuildDevServer } from './server/devServer';
21
21
  export type { StartServerResult } from './server/helper';
22
- export type { AliasStrategy, AppIcon, AppIconItem, Build, BuildOptions, BuildResult, BundlerPluginInstance, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SplitChunks, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles, } from './types';
22
+ export type { AliasStrategy, AppIcon, AppIconItem, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SplitChunks, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles, } from './types';
@@ -2,7 +2,7 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
2
2
  import type { SecureServerSessionOptions } from 'node:http2';
3
3
  import type { ServerOptions as HttpsServerOptions } from 'node:https';
4
4
  import type { URL } from 'node:url';
5
- import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions } from '@rspack/core';
5
+ import type { CopyRspackPluginOptions, DefinePluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions } from '@rspack/core';
6
6
  import type { CorsOptions } from 'cors';
7
7
  import type RspackChain from '../../compiled/rspack-chain/types';
8
8
  import type { FileDescriptor } from 'rspack-manifest-plugin';
@@ -12,7 +12,7 @@ import type { RsbuildDevServer } from '../server/devServer';
12
12
  import type { EnvironmentContext, ModifyBundlerChainUtils, ModifyChainUtils, Routes } from './hooks';
13
13
  import type { RsbuildPlugins } from './plugin';
14
14
  import type { RsbuildEntry, RsbuildMode, RsbuildTarget } from './rsbuild';
15
- import type { BundlerPluginInstance, Rspack, RspackRule } from './rspack';
15
+ import type { Rspack, RspackRule } from './rspack';
16
16
  import type { Connect, CSSExtractOptions, CSSLoaderModulesOptions, CSSLoaderOptions, HtmlRspackPlugin, LoosePostCSSPlugin, PostCSSLoaderOptions, StyleLoaderOptions } from './thirdParty';
17
17
  import type { ConfigChain, ConfigChainMergeContext, ConfigChainWithContext, LiteralUnion, MaybePromise, OneOrMany, Optional, TwoLevelReadonly } from './utils';
18
18
  export type ToolsSwcConfig = ConfigChain<SwcLoaderOptions>;
@@ -39,8 +39,8 @@ export type RspackMerge = (firstConfiguration: Rspack.Configuration | Rspack.Con
39
39
  export type ModifyRspackConfigUtils = ModifyChainUtils & {
40
40
  addRules: (rules: RspackRule | RspackRule[]) => void;
41
41
  appendRules: (rules: RspackRule | RspackRule[]) => void;
42
- prependPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
43
- appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
42
+ prependPlugins: (plugins: Rspack.RspackPluginInstance | Rspack.RspackPluginInstance[]) => void;
43
+ appendPlugins: (plugins: Rspack.RspackPluginInstance | Rspack.RspackPluginInstance[]) => void;
44
44
  removePlugin: (pluginName: string) => void;
45
45
  mergeConfig: RspackMerge;
46
46
  };
@@ -133,7 +133,6 @@ export type NormalizedToolsConfig = ToolsConfig & {
133
133
  cssExtract: Required<CSSExtractOptions>;
134
134
  };
135
135
  export type Alias = Record<string, string | false | (string | false)[]>;
136
- export type Define = Record<string, any>;
137
136
  export type AliasStrategy = 'prefer-tsconfig' | 'prefer-alias';
138
137
  export type Decorators = {
139
138
  /**
@@ -193,7 +192,7 @@ export interface SourceConfig {
193
192
  * Replaces variables in your code with other values or expressions at compile time.
194
193
  * This is useful for enabling different behavior between development and production builds.
195
194
  */
196
- define?: Define;
195
+ define?: DefinePluginOptions;
197
196
  /**
198
197
  * Configuring decorators syntax.
199
198
  */
@@ -211,16 +210,18 @@ export interface SourceConfig {
211
210
  export type TransformImport = {
212
211
  libraryName: string;
213
212
  libraryDirectory?: string;
213
+ customName?: string;
214
+ customStyleName?: string;
214
215
  style?: string | boolean;
215
216
  styleLibraryDirectory?: string;
216
217
  camelToDashComponentName?: boolean;
217
218
  transformToDefaultImport?: boolean;
218
- customName?: any;
219
- customStyleName?: any;
219
+ ignoreEsComponent?: string[];
220
+ ignoreStyleComponent?: string[];
220
221
  };
221
222
  type TransformImportFn = (imports: TransformImport[]) => TransformImport[] | void;
222
223
  export interface NormalizedSourceConfig extends SourceConfig {
223
- define: Define;
224
+ define: DefinePluginOptions;
224
225
  preEntry: string[];
225
226
  decorators: Required<Decorators>;
226
227
  }
@@ -587,11 +588,6 @@ export interface PerformanceConfig {
587
588
  * @default false
588
589
  */
589
590
  removeConsole?: boolean | ConsoleType[];
590
- /**
591
- * Whether to remove the locales of [moment.js](https://momentjs.com/).
592
- * @default false
593
- */
594
- removeMomentLocale?: boolean;
595
591
  /**
596
592
  * To enable or configure persistent build cache.
597
593
  * @experimental This feature is experimental and may be changed in the future.
@@ -660,11 +656,7 @@ export interface NormalizedPerformanceConfig extends PerformanceConfig {
660
656
  printFileSize: PrintFileSizeOptions | boolean;
661
657
  chunkSplit: ChunkSplit;
662
658
  }
663
- export type SplitChunks = Configuration extends {
664
- optimization?: {
665
- splitChunks?: infer P;
666
- };
667
- } ? P : never;
659
+ export type SplitChunks = Rspack.OptimizationSplitChunksOptions | false;
668
660
  export type ForceSplitting = RegExp[] | Record<string, RegExp>;
669
661
  export interface BaseSplitRules {
670
662
  strategy?: string;
@@ -7,10 +7,4 @@ declare module '@rspack/core' {
7
7
  __rsbuildTransformer?: Record<string, TransformHandler>;
8
8
  }
9
9
  }
10
- export interface BundlerPluginInstance {
11
- [index: string]: any;
12
- apply: (compiler: any) => void;
13
- }
14
- /** T[] => T */
15
- type GetElementType<T extends any[]> = T extends (infer U)[] ? U : never;
16
- export type RspackRule = GetElementType<Rspack.RuleSetRules>;
10
+ export type RspackRule = Rspack.RuleSetRules[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -36,7 +36,7 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rspack/core": "~1.7.2",
39
+ "@rspack/core": "2.0.0-alpha.0",
40
40
  "@rspack/lite-tapable": "~1.1.0",
41
41
  "@swc/helpers": "^0.5.18",
42
42
  "jiti": "^2.6.1"
@@ -52,16 +52,16 @@
52
52
  "devDependencies": {
53
53
  "@jridgewell/remapping": "^2.3.5",
54
54
  "@jridgewell/trace-mapping": "^0.3.31",
55
- "@rslib/core": "0.19.1",
55
+ "@rslib/core": "0.19.2",
56
56
  "@types/connect": "3.4.38",
57
57
  "@types/cors": "^2.8.19",
58
- "@types/node": "^24.10.7",
58
+ "@types/node": "^24.10.9",
59
59
  "@types/on-finished": "2.3.5",
60
60
  "@types/range-parser": "^1.2.7",
61
61
  "@types/ws": "^8.18.1",
62
62
  "browserslist-load-config": "1.0.1",
63
63
  "cac": "^6.7.14",
64
- "chokidar": "^4.0.3",
64
+ "chokidar": "^5.0.0",
65
65
  "connect": "3.7.0",
66
66
  "cors": "^2.8.5",
67
67
  "css-loader": "7.1.2",
@@ -78,12 +78,12 @@
78
78
  "postcss": "^8.5.6",
79
79
  "postcss-load-config": "6.0.1",
80
80
  "postcss-loader": "8.2.0",
81
- "prebundle": "1.6.0",
81
+ "prebundle": "1.6.2",
82
82
  "range-parser": "^1.2.1",
83
83
  "reduce-configs": "^1.1.1",
84
84
  "rslog": "^1.3.2",
85
- "rspack-chain": "^1.4.3",
86
- "rspack-manifest-plugin": "5.2.0",
85
+ "rspack-chain": "^2.0.0-alpha.0",
86
+ "rspack-manifest-plugin": "5.2.1",
87
87
  "sirv": "^3.0.2",
88
88
  "stacktrace-parser": "^0.1.11",
89
89
  "style-loader": "3.3.4",