@rspack/core 2.0.0-beta.6 → 2.0.0-beta.7

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.
@@ -15,11 +15,19 @@ export type SwcLoaderOptions = Config & {
15
15
  * providing better TypeScript development experience and smaller output bundle size.
16
16
  */
17
17
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
18
+ /**
19
+ * Ported from [babel-plugin-import](https://github.com/umijs/babel-plugin-import),
20
+ * used to transform imports for modular component libraries.
21
+ */
22
+ transformImport?: PluginImportOptions;
18
23
  /**
19
24
  * Experimental features provided by Rspack.
20
25
  * @experimental
21
26
  */
22
27
  rspackExperiments?: {
28
+ /**
29
+ * @deprecated Use top-level `transformImport` instead.
30
+ */
23
31
  import?: PluginImportOptions;
24
32
  /**
25
33
  * Enable React Server Components support.
@@ -1,10 +1,10 @@
1
- import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '@rspack/binding';
1
+ import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorConnectionsOnlyImport, type JsRsdoctorConnectionsOnlyImportConnection, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '@rspack/binding';
2
2
  import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist';
3
3
  import { type Compilation } from '../Compilation.js';
4
4
  import type { Compiler } from '../Compiler.js';
5
5
  import type { CreatePartialRegisters } from '../taps/types.js';
6
6
  export declare namespace RsdoctorPluginData {
7
- export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch, };
7
+ export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorConnectionsOnlyImport as RsdoctorConnectionsOnlyImport, JsRsdoctorConnectionsOnlyImportConnection as RsdoctorConnectionsOnlyImportConnection, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch, };
8
8
  }
9
9
  export type RsdoctorPluginOptions = {
10
10
  moduleGraphFeatures?: boolean | ('graph' | 'ids' | 'sources')[];
@@ -8,6 +8,7 @@ export declare class WorkerPlugin extends RspackBuiltinPlugin {
8
8
  private module;
9
9
  private workerPublicPath;
10
10
  name: BuiltinPluginName;
11
+ affectedHooks: "compilation";
11
12
  constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
12
13
  raw(compiler: Compiler): BuiltinPlugin;
13
14
  }
@@ -2,9 +2,34 @@ import type binding from '@rspack/binding';
2
2
  import type { Compiler } from '../../index.js';
3
3
  import { RspackBuiltinPlugin } from '../base.js';
4
4
  import { type Coordinator } from './Coordinator.js';
5
+ /** Manifest export entry (server/client actions, module refs). */
6
+ export interface RscManifestExport {
7
+ id: string;
8
+ name: string;
9
+ chunks: string[];
10
+ async?: boolean;
11
+ }
12
+ /** Map of export name to manifest export. */
13
+ export type RscManifestNode = Record<string, RscManifestExport>;
14
+ /** Module loading config (prefix, crossOrigin). */
15
+ export interface RscModuleLoading {
16
+ prefix: string;
17
+ crossOrigin?: 'use-credentials' | '';
18
+ }
19
+ export interface RscManifestPerEntry {
20
+ serverManifest: Record<string, RscManifestExport>;
21
+ clientManifest: Record<string, RscManifestExport>;
22
+ serverConsumerModuleMap: Record<string, RscManifestNode>;
23
+ moduleLoading: RscModuleLoading;
24
+ entryCssFiles: Record<string, string[]>;
25
+ entryJsFiles: string[];
26
+ }
27
+ /** Full RSC manifest (all entries) passed to onManifest. Map from entry name to per-entry manifest. */
28
+ export type RscManifest = Record<string, RscManifestPerEntry>;
5
29
  export type RscServerPluginOptions = {
6
30
  coordinator: Coordinator;
7
31
  onServerComponentChanges?: () => Promise<void>;
32
+ onManifest?: (manifest: RscManifest) => void | Promise<void>;
8
33
  };
9
34
  export declare class RscServerPlugin extends RspackBuiltinPlugin {
10
35
  #private;
@@ -10,7 +10,7 @@
10
10
  import type { ReadStream } from 'node:fs';
11
11
  import type { IncomingMessage, ServerResponse } from 'node:http';
12
12
  import type { ServerOptions } from 'node:https';
13
- import type { Server as ConnectApplication } from '../../compiled/connect-next';
13
+ import type { Server as ConnectApplication, NextFunction } from '../../compiled/connect-next';
14
14
  import type { Filter as ProxyFilter, Options as ProxyOptions } from '../../compiled/http-proxy-middleware';
15
15
  import type { Options as OpenOptions } from '../../compiled/open';
16
16
  import type { Compiler, Configuration, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from '../index.js';
@@ -18,12 +18,14 @@ type Logger = ReturnType<Compiler['getInfrastructureLogger']>;
18
18
  type MultiWatching = MultiCompiler['watch'];
19
19
  export type DevServerHost = LiteralUnion<'local-ip' | 'local-ipv4' | 'local-ipv6', string>;
20
20
  type BasicServer = import('node:net').Server | import('node:tls').Server;
21
- export type DevServerOpenOptions = OpenOptions;
21
+ export type DevServerOpenOptions = OpenOptions & {
22
+ target?: string | string[];
23
+ };
22
24
  type ResponseData = {
23
25
  data: Buffer | ReadStream;
24
26
  byteLength: number;
25
27
  };
26
- type ModifyResponseData<RequestInternal extends IncomingMessage = IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = (req: RequestInternal, res: ResponseInternal, data: Buffer | ReadStream, byteLength: number) => ResponseData;
28
+ type ModifyResponseData<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (req: Req, res: Res, data: Buffer | ReadStream, byteLength: number) => ResponseData;
27
29
  export type DevServerHeaders = {
28
30
  key: string;
29
31
  value: string;
@@ -51,7 +53,7 @@ type HistoryApiFallbackOptions = {
51
53
  readonly rewrites?: readonly Rewrite[];
52
54
  readonly verbose?: boolean;
53
55
  };
54
- type DevMiddlewareOptions<RequestInternal extends IncomingMessage = IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = {
56
+ type DevMiddlewareOptions<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = {
55
57
  mimeTypes?: {
56
58
  [key: string]: string;
57
59
  };
@@ -64,7 +66,7 @@ type DevMiddlewareOptions<RequestInternal extends IncomingMessage = IncomingMess
64
66
  serverSideRender?: boolean;
65
67
  outputFileSystem?: OutputFileSystem;
66
68
  index?: string | boolean;
67
- modifyResponseData?: ModifyResponseData<RequestInternal, ResponseInternal>;
69
+ modifyResponseData?: ModifyResponseData<Req, Res>;
68
70
  etag?: 'strong' | 'weak';
69
71
  lastModified?: boolean;
70
72
  cacheControl?: string | number | boolean | {
@@ -77,9 +79,6 @@ type BasicApplication = any;
77
79
  type ChokidarWatchOptions = {
78
80
  [key: string]: any;
79
81
  };
80
- type ServeIndexOptions = {
81
- [key: string]: any;
82
- };
83
82
  type ServeStaticOptions = {
84
83
  [key: string]: any;
85
84
  };
@@ -87,20 +86,14 @@ type WatchFiles = {
87
86
  paths: string | string[];
88
87
  options?: ChokidarWatchOptions & {
89
88
  aggregateTimeout?: number;
90
- ignored?: ChokidarWatchOptions['ignored'];
91
89
  poll?: number | boolean;
92
90
  };
93
91
  };
94
92
  export type DevServerStaticItem = {
95
93
  directory?: string;
96
94
  publicPath?: string | string[];
97
- serveIndex?: boolean | ServeIndexOptions;
98
95
  staticOptions?: ServeStaticOptions;
99
- watch?: boolean | (ChokidarWatchOptions & {
100
- aggregateTimeout?: number;
101
- ignored?: ChokidarWatchOptions['ignored'];
102
- poll?: number | boolean;
103
- });
96
+ watch?: boolean | NonNullable<WatchFiles['options']>;
104
97
  };
105
98
  export type DevServerStatic = string | boolean | DevServerStaticItem | (string | DevServerStaticItem)[];
106
99
  type ServerType<A extends BasicApplication, S extends BasicServer> = LiteralUnion<'http' | 'https' | 'http2', string> | ((arg0: ServerOptions, arg1: A) => S);
@@ -112,7 +105,6 @@ type WebSocketServerConfiguration = {
112
105
  type?: string | Function;
113
106
  options?: Record<string, any>;
114
107
  };
115
- type NextFunction = (err?: any) => void;
116
108
  export type DevServerProxyConfigArrayItem = {
117
109
  /**
118
110
  * Alias for `pathFilter` in `http-proxy-middleware` options.
@@ -122,7 +114,7 @@ export type DevServerProxyConfigArrayItem = {
122
114
  } & ProxyOptions;
123
115
  export type DevServerProxyConfigArray = (DevServerProxyConfigArrayItem | ((req?: IncomingMessage, res?: ServerResponse, next?: NextFunction) => DevServerProxyConfigArrayItem))[];
124
116
  type Callback = (stats?: Stats | MultiStats) => any;
125
- type DevMiddlewareContext<_RequestInternal extends IncomingMessage = IncomingMessage, _ResponseInternal extends ServerResponse = ServerResponse> = {
117
+ type DevMiddlewareContext = {
126
118
  state: boolean;
127
119
  stats: Stats | MultiStats | undefined;
128
120
  callbacks: Callback[];
@@ -132,13 +124,14 @@ type DevMiddlewareContext<_RequestInternal extends IncomingMessage = IncomingMes
132
124
  logger: Logger;
133
125
  outputFileSystem: OutputFileSystem;
134
126
  };
135
- export type DevServerMiddlewareHandler<RequestInternal extends IncomingMessage = IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = (req: RequestInternal, res: ResponseInternal, next: NextFunction) => void | Promise<void>;
136
- type DevServerMiddlewareObject<RequestInternal extends IncomingMessage = IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = {
127
+ export type DevServerMiddlewareHandler<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (req: Req, res: Res, next: NextFunction) => void | Promise<void>;
128
+ export type DevServerMiddlewareErrorHandler<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (error: any, req: Req, res: Res, next: NextFunction) => void | Promise<void>;
129
+ export type DevServerMiddlewareObject<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = {
137
130
  name?: string;
138
131
  path?: string;
139
- middleware: DevServerMiddlewareHandler<RequestInternal, ResponseInternal>;
132
+ middleware: DevServerMiddlewareHandler<Req, Res> | DevServerMiddlewareErrorHandler<Req, Res>;
140
133
  };
141
- export type DevServerMiddleware = DevServerMiddlewareObject | DevServerMiddlewareHandler;
134
+ export type DevServerMiddleware = DevServerMiddlewareObject | DevServerMiddlewareHandler | DevServerMiddlewareErrorHandler;
142
135
  type OverlayMessageOptions = boolean | ((error: Error) => void);
143
136
  export type DevServerWebSocketURL = {
144
137
  hostname?: string;
@@ -176,7 +169,7 @@ export type DevServerOptions<A extends BasicApplication = ConnectApplication, S
176
169
  app?: () => Promise<A>;
177
170
  webSocketServer?: boolean | LiteralUnion<'ws', string> | WebSocketServerConfiguration;
178
171
  proxy?: DevServerProxyConfigArray;
179
- open?: string | boolean | OpenOptions | (string | OpenOptions)[];
172
+ open?: string | boolean | DevServerOpenOptions | (string | DevServerOpenOptions)[];
180
173
  setupExitSignals?: boolean;
181
174
  client?: boolean | DevServerClient;
182
175
  headers?: DevServerHeaders | ((req: IncomingMessage, res: ServerResponse, context: DevMiddlewareContext | undefined) => DevServerHeaders);
@@ -592,7 +592,6 @@ export type ResolveOptions = {
592
592
  restrictions?: string[];
593
593
  /**
594
594
  * A list of directories where server-relative URLs (beginning with '/') are resolved.
595
- * It defaults to the context configuration option.
596
595
  * On systems other than Windows, these requests are initially resolved as an absolute path.
597
596
  * @default []
598
597
  */
@@ -1934,8 +1933,6 @@ export type Optimization = {
1934
1933
  * @default false
1935
1934
  */
1936
1935
  runtimeChunk?: OptimizationRuntimeChunk;
1937
- /** Detect and remove modules from chunks these modules are already included in all parents. */
1938
- removeAvailableModules?: boolean;
1939
1936
  /**
1940
1937
  * Remove empty chunks generated in the compilation.
1941
1938
  * @default true
@@ -2232,7 +2229,7 @@ export type WatchOptions = {
2232
2229
  * Options for dev server
2233
2230
  * */
2234
2231
  export type DevServer = DevServerOptions;
2235
- export type { DevServerClient, DevServerHeaders, DevServerHost, DevServerMiddleware, DevServerMiddlewareHandler, DevServerOpenOptions, DevServerProxyConfigArray, DevServerProxyConfigArrayItem, DevServerStatic, DevServerStaticItem, DevServerWebSocketURL, } from './devServer.js';
2232
+ export type { DevServerClient, DevServerHeaders, DevServerHost, DevServerMiddleware, DevServerMiddlewareHandler, DevServerMiddlewareObject, DevServerOpenOptions, DevServerProxyConfigArray, DevServerProxyConfigArrayItem, DevServerStatic, DevServerStaticItem, DevServerWebSocketURL, } from './devServer.js';
2236
2233
  /**
2237
2234
  * Ignore specific warnings.
2238
2235
  */
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import node_path, { isAbsolute, join, relative, resolve as external_node_path_re
8
8
  import node_querystring from "node:querystring";
9
9
  import node_fs, { readFileSync } from "node:fs";
10
10
  __webpack_require__.add({
11
- "../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
11
+ "../../node_modules/.pnpm/enhanced-resolve@5.20.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
12
12
  let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
13
13
  let idx = path.length - 1;
14
14
  for(; idx >= 0;){
@@ -1554,7 +1554,8 @@ class MergeCaller {
1554
1554
  return this.callArgs;
1555
1555
  }
1556
1556
  push(...data) {
1557
- 0 === this.callArgs.length && queueMicrotask(this.finalCall), this.callArgs.push(...data);
1557
+ 0 === this.callArgs.length && queueMicrotask(this.finalCall);
1558
+ for(let i = 0; i < data.length; i++)this.callArgs.push(data[i]);
1558
1559
  }
1559
1560
  }
1560
1561
  function createFakeCompilationDependencies(getDeps, addDeps) {
@@ -2982,6 +2983,25 @@ function toFeatures(featureOptions) {
2982
2983
  }
2983
2984
  return feature;
2984
2985
  }
2986
+ function resolvePluginImport(pluginImport) {
2987
+ if (pluginImport) return pluginImport.map((config)=>{
2988
+ let rawConfig = {
2989
+ ...config,
2990
+ style: {}
2991
+ };
2992
+ if ('boolean' == typeof config.style) rawConfig.style.bool = config.style;
2993
+ else if ('string' == typeof config.style) {
2994
+ let isTpl = config.style.includes('{{');
2995
+ rawConfig.style[isTpl ? 'custom' : 'css'] = config.style;
2996
+ } else {
2997
+ var val;
2998
+ val = config.style, '[object Object]' === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
2999
+ }
3000
+ return config.styleLibraryDirectory && (rawConfig.style = {
3001
+ styleLibraryDirectory: config.styleLibraryDirectory
3002
+ }), rawConfig;
3003
+ });
3004
+ }
2985
3005
  let $assets = Symbol('assets');
2986
3006
  Object.defineProperty(binding_default().KnownBuildInfo.prototype, node_util.inspect.custom, {
2987
3007
  enumerable: !0,
@@ -4180,27 +4200,9 @@ function createRawModuleRuleUses(uses, path, options) {
4180
4200
  options.collectTypeScriptInfo && (options.collectTypeScriptInfo = {
4181
4201
  typeExports: (options1 = options.collectTypeScriptInfo).typeExports,
4182
4202
  exportedEnum: !0 === options1.exportedEnum ? 'all' : !1 === options1.exportedEnum || void 0 === options1.exportedEnum ? 'none' : 'const-only'
4183
- });
4203
+ }), options.transformImport && (options.transformImport = resolvePluginImport(options.transformImport));
4184
4204
  let { rspackExperiments } = options;
4185
- rspackExperiments && (rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
4186
- if (pluginImport) return pluginImport.map((config)=>{
4187
- let rawConfig = {
4188
- ...config,
4189
- style: {}
4190
- };
4191
- if ('boolean' == typeof config.style) rawConfig.style.bool = config.style;
4192
- else if ('string' == typeof config.style) {
4193
- let isTpl = config.style.includes('{{');
4194
- rawConfig.style[isTpl ? 'custom' : 'css'] = config.style;
4195
- } else {
4196
- var val;
4197
- val = config.style, '[object Object]' === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
4198
- }
4199
- return config.styleLibraryDirectory && (rawConfig.style = {
4200
- styleLibraryDirectory: config.styleLibraryDirectory
4201
- }), rawConfig;
4202
- });
4203
- }(rspackExperiments.import || rspackExperiments.pluginImport));
4205
+ rspackExperiments && (rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = resolvePluginImport(rspackExperiments.import || rspackExperiments.pluginImport));
4204
4206
  }
4205
4207
  return options;
4206
4208
  })(o, options);
@@ -5149,9 +5151,13 @@ class RscServerPlugin extends RspackBuiltinPlugin {
5149
5151
  super(), this.#options = options;
5150
5152
  }
5151
5153
  raw(compiler) {
5152
- return this.#options.coordinator.applyServerCompiler(compiler), createBuiltinPlugin(this.name, {
5153
- coordinator: this.#options.coordinator[GET_OR_INIT_BINDING](),
5154
- onServerComponentChanges: this.#options.onServerComponentChanges
5154
+ let onManifest;
5155
+ this.#options.coordinator.applyServerCompiler(compiler);
5156
+ let { coordinator, onServerComponentChanges } = this.#options;
5157
+ return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))), createBuiltinPlugin(this.name, {
5158
+ coordinator: coordinator[GET_OR_INIT_BINDING](),
5159
+ onServerComponentChanges,
5160
+ onManifest
5155
5161
  });
5156
5162
  }
5157
5163
  }
@@ -5356,6 +5362,7 @@ class WorkerPlugin extends RspackBuiltinPlugin {
5356
5362
  module;
5357
5363
  workerPublicPath;
5358
5364
  name = binding_namespaceObject.BuiltinPluginName.WorkerPlugin;
5365
+ affectedHooks = 'compilation';
5359
5366
  constructor(chunkLoading, wasmLoading, module, workerPublicPath){
5360
5367
  super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
5361
5368
  }
@@ -6514,7 +6521,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6514
6521
  }), F(options, 'performance', ()=>!!production && !!targetProperties && (!!targetProperties.browser || null === targetProperties.browser) && {}), applyPerformanceDefaults(options.performance, {
6515
6522
  production
6516
6523
  }), options.resolve = cleverMerge(getResolveDefaults({
6517
- context: options.context,
6518
6524
  targetProperties,
6519
6525
  mode: options.mode
6520
6526
  }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader), !1 === targetProperties ? targetProperties : {
@@ -6810,7 +6816,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6810
6816
  return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
6811
6817
  desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
6812
6818
  }), Array.from(enabledWasmLoadingTypes);
6813
- }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.6"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !output.library));
6819
+ }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.7"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !output.library));
6814
6820
  }, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
6815
6821
  let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
6816
6822
  D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
@@ -6828,7 +6834,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6828
6834
  }, applyPerformanceDefaults = (performance, { production })=>{
6829
6835
  !1 !== performance && (D(performance, 'maxAssetSize', 250000), D(performance, 'maxEntrypointSize', 250000), F(performance, 'hints', ()=>!!production && 'warning'));
6830
6836
  }, applyOptimizationDefaults = (optimization, { production, development })=>{
6831
- D(optimization, 'removeAvailableModules', !0), D(optimization, 'removeEmptyChunks', !0), D(optimization, 'mergeDuplicateChunks', !0), F(optimization, 'moduleIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'chunkIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'sideEffects', ()=>!!production || 'flag'), D(optimization, 'mangleExports', production), D(optimization, 'inlineExports', production), D(optimization, 'providedExports', !0), D(optimization, 'usedExports', production), D(optimization, 'innerGraph', production), D(optimization, 'emitOnErrors', !production), D(optimization, 'runtimeChunk', !1), D(optimization, 'realContentHash', production), D(optimization, 'avoidEntryIife', !1), D(optimization, 'minimize', production), D(optimization, 'concatenateModules', production), A(optimization, 'minimizer', ()=>[
6837
+ D(optimization, 'removeEmptyChunks', !0), D(optimization, 'mergeDuplicateChunks', !0), F(optimization, 'moduleIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'chunkIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'sideEffects', ()=>!!production || 'flag'), D(optimization, 'mangleExports', production), D(optimization, 'inlineExports', production), D(optimization, 'providedExports', !0), D(optimization, 'usedExports', production), D(optimization, 'innerGraph', production), D(optimization, 'emitOnErrors', !production), D(optimization, 'runtimeChunk', !1), D(optimization, 'realContentHash', production), D(optimization, 'avoidEntryIife', !1), D(optimization, 'minimize', production), D(optimization, 'concatenateModules', production), A(optimization, 'minimizer', ()=>[
6832
6838
  new SwcJsMinimizerRspackPlugin(),
6833
6839
  new LightningCssMinimizerRspackPlugin()
6834
6840
  ]), F(optimization, 'nodeEnv', ()=>production ? 'production' : !!development && 'development');
@@ -6871,15 +6877,14 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6871
6877
  mainFiles: [
6872
6878
  'index'
6873
6879
  ]
6874
- }), getResolveDefaults = ({ context, targetProperties, mode })=>{
6880
+ }), getResolveDefaults = ({ targetProperties, mode })=>{
6875
6881
  let conditions = [
6876
6882
  'webpack'
6877
6883
  ];
6878
6884
  conditions.push('development' === mode ? 'development' : 'production'), targetProperties && (targetProperties.webworker && conditions.push('worker'), targetProperties.node && conditions.push('node'), targetProperties.web && conditions.push('browser'), targetProperties.electron && conditions.push('electron'), targetProperties.nwjs && conditions.push('nwjs'));
6879
6885
  let jsExtensions = [
6880
6886
  '.js',
6881
- '.json',
6882
- '.wasm'
6887
+ '.json'
6883
6888
  ], browserField = targetProperties && targetProperties.web && (!targetProperties.node || targetProperties.electron && targetProperties.electronRenderer), aliasFields = browserField ? [
6884
6889
  'browser'
6885
6890
  ] : [], mainFields = browserField ? [
@@ -6925,9 +6930,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6925
6930
  exportsFields: [
6926
6931
  'exports'
6927
6932
  ],
6928
- roots: [
6929
- context
6930
- ],
6933
+ roots: [],
6931
6934
  mainFields: [
6932
6935
  'main'
6933
6936
  ],
@@ -6950,14 +6953,17 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6950
6953
  loader: cjsDeps(),
6951
6954
  unknown: cjsDeps()
6952
6955
  }
6953
- }, styleConditions = [];
6954
- return styleConditions.push('webpack'), styleConditions.push('development' === mode ? 'development' : 'production'), styleConditions.push('style'), resolveOptions.byDependency['css-import'] = {
6956
+ };
6957
+ return resolveOptions.byDependency['css-import'] = {
6955
6958
  mainFiles: [],
6956
6959
  mainFields: [
6957
6960
  'style',
6958
6961
  '...'
6959
6962
  ],
6960
- conditionNames: styleConditions,
6963
+ conditionNames: [
6964
+ 'development' === mode ? 'development' : 'production',
6965
+ 'style'
6966
+ ],
6961
6967
  extensions: [
6962
6968
  '.css'
6963
6969
  ],
@@ -8064,7 +8070,7 @@ class MultiStats {
8064
8070
  obj.children = this.stats.map((stat, idx)=>{
8065
8071
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8066
8072
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8067
- }), childOptions.version && (obj.rspackVersion = "2.0.0-beta.6", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8073
+ }), childOptions.version && (obj.rspackVersion = "2.0.0-beta.7", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8068
8074
  let mapError = (j, obj)=>({
8069
8075
  ...obj,
8070
8076
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8561,7 +8567,7 @@ let arraySum = (array)=>{
8561
8567
  let str = `${a}`, length = lengths[i];
8562
8568
  return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
8563
8569
  });
8564
- }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8570
+ }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.20.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8565
8571
  var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
8566
8572
  class NodeEnvironmentPlugin {
8567
8573
  options;
@@ -9323,7 +9329,7 @@ let iterateConfig = (config, options, fn)=>{
9323
9329
  object.hash = context.getStatsCompilation(compilation).hash;
9324
9330
  },
9325
9331
  version: (object)=>{
9326
- object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.6";
9332
+ object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.7";
9327
9333
  },
9328
9334
  env: (object, _compilation, _context, { _env })=>{
9329
9335
  object.env = _env;
@@ -10988,7 +10994,7 @@ class TraceHookPlugin {
10988
10994
  });
10989
10995
  }
10990
10996
  }
10991
- let CORE_VERSION = "2.0.0-beta.6", VFILES_BY_COMPILER = new WeakMap();
10997
+ let CORE_VERSION = "2.0.0-beta.7", VFILES_BY_COMPILER = new WeakMap();
10992
10998
  class VirtualModulesPlugin {
10993
10999
  #staticModules;
10994
11000
  #compiler;
@@ -13282,7 +13288,7 @@ async function transform(source, options) {
13282
13288
  let _options = JSON.stringify(options || {});
13283
13289
  return binding_default().transform(source, _options);
13284
13290
  }
13285
- let exports_rspackVersion = "2.0.0-beta.6", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13291
+ let exports_rspackVersion = "2.0.0-beta.7", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13286
13292
  getNormalizedRspackOptions: getNormalizedRspackOptions,
13287
13293
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
13288
13294
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -7,9 +7,7 @@ function __webpack_require__(moduleId) {
7
7
  };
8
8
  return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
9
9
  }
10
- __webpack_require__.m = __webpack_modules__, __webpack_require__.add = function(modules) {
11
- Object.assign(__webpack_require__.m, modules);
12
- }, __webpack_require__.n = (module)=>{
10
+ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
13
11
  var getter = module && module.__esModule ? ()=>module.default : ()=>module;
14
12
  return __webpack_require__.d(getter, {
15
13
  a: getter
@@ -19,6 +17,8 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.add = function(
19
17
  enumerable: !0,
20
18
  get: definition[key]
21
19
  });
20
+ }, __webpack_require__.add = function(modules) {
21
+ Object.assign(__webpack_require__.m, modules);
22
22
  }, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
23
23
  "u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
24
24
  value: 'Module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Fast Rust-based bundler for the web with a modernized webpack API",
@@ -37,18 +37,18 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.41.0",
40
+ "@ast-grep/napi": "^0.41.1",
41
41
  "@napi-rs/wasm-runtime": "1.0.7",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.4",
43
- "@rslib/core": "0.19.6",
43
+ "@rslib/core": "0.20.0",
44
44
  "@rspack/lite-tapable": "1.1.0",
45
45
  "@swc/types": "0.1.25",
46
- "@types/node": "^20.19.35",
46
+ "@types/node": "^20.19.37",
47
47
  "@types/watchpack": "^2.4.5",
48
48
  "browserslist-load-config": "^1.0.1",
49
49
  "browserslist-to-es-version": "^1.4.1",
50
50
  "connect-next": "^4.0.0",
51
- "enhanced-resolve": "5.19.0",
51
+ "enhanced-resolve": "5.20.0",
52
52
  "http-proxy-middleware": "^3.0.5",
53
53
  "memfs": "4.53.0",
54
54
  "open": "^11.0.0",
@@ -59,7 +59,7 @@
59
59
  "webpack-sources": "3.3.4"
60
60
  },
61
61
  "dependencies": {
62
- "@rspack/binding": "2.0.0-beta.6"
62
+ "@rspack/binding": "2.0.0-beta.7"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",