@rspack-canary/core 1.6.0-canary-e28e40e9-20251022173516 → 1.6.0-canary-4ad8b49f-20251023175711

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.
@@ -7,6 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
+ import type { MultiStatsOptions, StatsPresets } from "./config";
10
11
  import type { Stats } from "./Stats";
11
12
  import type { StatsCompilation } from "./stats/statsFactoryUtils";
12
13
  export default class MultiStats {
@@ -16,7 +17,7 @@ export default class MultiStats {
16
17
  get hash(): string;
17
18
  hasErrors(): boolean;
18
19
  hasWarnings(): boolean;
19
- toJson(options: any): StatsCompilation;
20
- toString(options: any): string;
20
+ toJson(options: boolean | StatsPresets | MultiStatsOptions): StatsCompilation;
21
+ toString(options: boolean | StatsPresets | MultiStatsOptions): string;
21
22
  }
22
23
  export { MultiStats };
@@ -0,0 +1,9 @@
1
+ export declare const InlineExportsPlugin: {
2
+ new (): {
3
+ name: string;
4
+ _args: [];
5
+ affectedHooks: keyof import("..").CompilerHooks | undefined;
6
+ raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
7
+ apply(compiler: import("..").Compiler): void;
8
+ };
9
+ };
@@ -1,3 +1,4 @@
1
+ import type { LiteralUnion } from "../config";
1
2
  import type { AssetConditions } from "../util/assetCondition";
2
3
  type ExtractCommentsCondition = boolean | RegExp;
3
4
  type ExtractCommentsBanner = string | boolean;
@@ -132,7 +133,7 @@ export interface JsFormatOptions {
132
133
  */
133
134
  wrapFuncArgs?: boolean;
134
135
  }
135
- export type TerserEcmaVersion = 5 | 2015 | 2016 | string | number;
136
+ export type TerserEcmaVersion = LiteralUnion<5 | 2015 | 2016, number> | string;
136
137
  export interface TerserCompressOptions {
137
138
  arguments?: boolean;
138
139
  arrows?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { type RawCssExtractPluginOption } from "@rspack/binding";
2
- import type { Compiler } from "../..";
2
+ import type { Compiler, LiteralUnion } from "../..";
3
3
  export * from "./loader";
4
4
  export type { CssExtractRspackLoaderOptions } from "./loader";
5
5
  export interface CssExtractRspackPluginOptions {
@@ -8,7 +8,7 @@ export interface CssExtractRspackPluginOptions {
8
8
  ignoreOrder?: boolean;
9
9
  insert?: string | ((linkTag: HTMLLinkElement) => void);
10
10
  attributes?: Record<string, string>;
11
- linkType?: string | "text/css" | false;
11
+ linkType?: LiteralUnion<"text/css", string> | false;
12
12
  runtime?: boolean;
13
13
  pathinfo?: boolean;
14
14
  enforceRelative?: boolean;
@@ -40,6 +40,7 @@ export * from "./HttpUriPlugin";
40
40
  export * from "./html-plugin/index";
41
41
  export * from "./IgnorePlugin";
42
42
  export * from "./InferAsyncModulesPlugin";
43
+ export * from "./InlineExportsPlugin";
43
44
  export * from "./JavascriptModulesPlugin";
44
45
  export * from "./JsLoaderRspackPlugin";
45
46
  export * from "./JsonModulesPlugin";
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
9
9
  */
10
- import type { Compiler, MultiCompiler, MultiStats, Stats, Watching } from "..";
10
+ import type { Compiler, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from "..";
11
11
  type Logger = ReturnType<Compiler["getInfrastructureLogger"]>;
12
12
  type MultiWatching = MultiCompiler["watch"];
13
13
  type BasicServer = import("net").Server | import("tls").Server;
@@ -38,7 +38,7 @@ type OutputFileSystem = import("..").OutputFileSystem & {
38
38
  readFileSync: typeof import("fs").readFileSync;
39
39
  };
40
40
  type RspackConfiguration = import("..").Configuration;
41
- type Port = number | string | "auto";
41
+ type Port = number | LiteralUnion<"auto", string>;
42
42
  type HistoryContext = {
43
43
  readonly match: RegExpMatchArray;
44
44
  readonly parsedUrl: import("url").Url;
@@ -80,7 +80,7 @@ type DevMiddlewareOptions<RequestInternal extends IncomingMessage = IncomingMess
80
80
  cacheImmutable?: boolean | undefined;
81
81
  };
82
82
  type BasicApplication = any;
83
- type BonjourServer = any;
83
+ type BonjourServer = Record<string, any>;
84
84
  type ChokidarWatchOptions = {
85
85
  [key: string]: any;
86
86
  };
@@ -112,7 +112,7 @@ type Static = {
112
112
  poll?: number | boolean;
113
113
  }) | undefined;
114
114
  };
115
- type ServerType<A extends BasicApplication = BasicApplication, S extends BasicServer = import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>> = "http" | "https" | "spdy" | "http2" | string | ((arg0: ServerOptions, arg1: A) => S);
115
+ type ServerType<A extends BasicApplication = BasicApplication, S extends BasicServer = import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>> = LiteralUnion<"http" | "https" | "spdy" | "http2", string> | ((arg0: ServerOptions, arg1: A) => S);
116
116
  type ServerConfiguration<A extends BasicApplication = BasicApplication, S extends BasicServer = import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>> = {
117
117
  type?: ServerType<A, S> | undefined;
118
118
  options?: ServerOptions | undefined;
@@ -123,8 +123,8 @@ type WebSocketServerConfiguration = {
123
123
  };
124
124
  type NextFunction = (err?: any) => void;
125
125
  type ProxyConfigArrayItem = {
126
- path?: HttpProxyMiddlewareOptionsFilter | undefined;
127
- context?: HttpProxyMiddlewareOptionsFilter | undefined;
126
+ path?: HttpProxyMiddlewareOptionsFilter;
127
+ context?: HttpProxyMiddlewareOptionsFilter;
128
128
  } & {
129
129
  bypass?: ByPass;
130
130
  } & {
@@ -190,7 +190,7 @@ export type DevServerOptions<A extends BasicApplication = BasicApplication, S ex
190
190
  compress?: boolean | undefined;
191
191
  allowedHosts?: string | string[] | undefined;
192
192
  historyApiFallback?: boolean | HistoryApiFallbackOptions | undefined;
193
- bonjour?: boolean | Record<string, never> | BonjourServer | undefined;
193
+ bonjour?: boolean | BonjourServer | undefined;
194
194
  watchFiles?: string | string[] | WatchFiles | (string | WatchFiles)[] | undefined;
195
195
  static?: string | boolean | Static | (string | Static)[] | undefined;
196
196
  server?: ServerType<A, S> | ServerConfiguration<A, S> | undefined;
@@ -9,6 +9,8 @@ import type { Module } from "../Module";
9
9
  import type ModuleGraph from "../ModuleGraph";
10
10
  import type { ResolveCallback } from "./adapterRuleUse";
11
11
  import type { DevServerOptions } from "./devServer";
12
+ /** https://github.com/microsoft/TypeScript/issues/29729 */
13
+ export type LiteralUnion<T extends U, U> = T | (U & Record<never, never>);
12
14
  export type FilenameTemplate = string;
13
15
  export type Filename = FilenameTemplate | ((pathData: PathData, assetInfo?: AssetInfo) => string);
14
16
  /** Name of the configuration. Used when loading multiple configurations. */
@@ -27,17 +29,17 @@ export type Context = string;
27
29
  export type Mode = "development" | "production" | "none";
28
30
  export type Falsy = false | "" | 0 | null | undefined;
29
31
  /** The publicPath of the resource referenced by this entry. */
30
- export type PublicPath = "auto" | Filename;
32
+ export type PublicPath = LiteralUnion<"auto", string> | Exclude<Filename, string>;
31
33
  /** The baseURI of the resource referenced by this entry. */
32
34
  export type BaseUri = string;
33
35
  /** How this entry load other chunks. */
34
- export type ChunkLoadingType = string | "jsonp" | "import-scripts" | "require" | "async-node" | "import";
36
+ export type ChunkLoadingType = LiteralUnion<"jsonp" | "import-scripts" | "require" | "async-node" | "import", string>;
35
37
  /** How this entry load other chunks. */
36
38
  export type ChunkLoading = false | ChunkLoadingType;
37
39
  /** Whether to create a load-on-demand asynchronous chunk for entry. */
38
40
  export type AsyncChunks = boolean;
39
41
  /** Option to set the method of loading WebAssembly Modules. */
40
- export type WasmLoadingType = string | "fetch-streaming" | "fetch" | "async-node";
42
+ export type WasmLoadingType = LiteralUnion<"fetch-streaming" | "fetch" | "async-node", string>;
41
43
  /** Option to set the method of loading WebAssembly Modules. */
42
44
  export type WasmLoading = false | WasmLoadingType;
43
45
  export type ScriptType = false | "text/javascript" | "module";
@@ -61,7 +63,7 @@ export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
61
63
  /** Specify which export should be exposed as a library. */
62
64
  export type LibraryExport = string | string[];
63
65
  /** Configure how the library will be exposed. */
64
- export type LibraryType = string | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system";
66
+ export type LibraryType = LiteralUnion<"var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system", string>;
65
67
  /** When using output.library.type: "umd", setting output.library.umdNamedDefine to true will name the AMD module of the UMD build. */
66
68
  export type UmdNamedDefine = boolean;
67
69
  /** Options for library. */
@@ -1199,7 +1201,7 @@ export type SnapshotOptions = {};
1199
1201
  * cache: false
1200
1202
  */
1201
1203
  export type CacheOptions = boolean;
1202
- type StatsPresets = "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary";
1204
+ export type StatsPresets = "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary";
1203
1205
  type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
1204
1206
  type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
1205
1207
  export type StatsColorOptions = {
@@ -1600,6 +1602,9 @@ export type StatsOptions = {
1600
1602
  */
1601
1603
  warningsSpace?: number;
1602
1604
  };
1605
+ export type MultiStatsOptions = Omit<StatsOptions, "children"> & {
1606
+ children?: StatsValue | (StatsValue | undefined)[];
1607
+ };
1603
1608
  /**
1604
1609
  * Represents the value for stats configuration.
1605
1610
  */
@@ -14,9 +14,9 @@ __webpack_require__.d = (exports1, definition)=>{
14
14
  };
15
15
  var __webpack_exports__ = {};
16
16
  function normalizeUrl(url) {
17
- var urlString = url.trim();
17
+ let urlString = url.trim();
18
18
  if (/^data:/i.test(urlString)) return urlString;
19
- var protocol = -1 !== urlString.indexOf("//") ? "".concat(urlString.split("//")[0], "//") : "", components = urlString.replace(RegExp(protocol, "i"), "").split("/"), host = components[0].toLowerCase().replace(/\.$/, "");
19
+ let protocol = -1 !== urlString.indexOf("//") ? `${urlString.split("//")[0]}//` : "", components = urlString.replace(RegExp(protocol, "i"), "").split("/"), host = components[0].toLowerCase().replace(/\.$/, "");
20
20
  return components[0] = "", protocol + host + components.reduce((accumulator, item)=>{
21
21
  switch(item){
22
22
  case "..":
@@ -34,29 +34,29 @@ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_expo
34
34
  cssReload: ()=>cssReload,
35
35
  normalizeUrl: ()=>normalizeUrl
36
36
  });
37
- var srcByModuleId = Object.create(null), noDocument = "undefined" == typeof document, { forEach } = Array.prototype;
37
+ const srcByModuleId = Object.create(null), noDocument = "undefined" == typeof document, { forEach } = Array.prototype;
38
38
  function noop() {}
39
39
  function updateCss(el, url) {
40
+ let normalizedUrl;
40
41
  if (url) normalizedUrl = url;
41
42
  else {
42
- var normalizedUrl, href = el.getAttribute("href");
43
+ let href = el.getAttribute("href");
43
44
  if (!href) return;
44
45
  normalizedUrl = href.split("?")[0];
45
46
  }
46
- if (isUrlRequest(el.href) && !1 !== el.isLoaded && normalizedUrl && normalizedUrl.indexOf(".css") > -1) {
47
- el.visited = !0;
48
- var newEl = el.cloneNode();
49
- newEl.isLoaded = !1, newEl.addEventListener("load", ()=>{
50
- !newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
51
- }), newEl.addEventListener("error", ()=>{
52
- !newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
53
- }), newEl.href = "".concat(normalizedUrl, "?").concat(Date.now());
54
- var parent = el.parentNode;
55
- parent && (el.nextSibling ? parent.insertBefore(newEl, el.nextSibling) : parent.appendChild(newEl));
56
- }
47
+ if (!isUrlRequest(el.href) || !1 === el.isLoaded || !normalizedUrl || !(normalizedUrl.indexOf(".css") > -1)) return;
48
+ el.visited = !0;
49
+ let newEl = el.cloneNode();
50
+ newEl.isLoaded = !1, newEl.addEventListener("load", ()=>{
51
+ !newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
52
+ }), newEl.addEventListener("error", ()=>{
53
+ !newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
54
+ }), newEl.href = `${normalizedUrl}?${Date.now()}`;
55
+ let parent = el.parentNode;
56
+ parent && (el.nextSibling ? parent.insertBefore(newEl, el.nextSibling) : parent.appendChild(newEl));
57
57
  }
58
58
  function reloadAll() {
59
- var elements = document.querySelectorAll("link");
59
+ let elements = document.querySelectorAll("link");
60
60
  forEach.call(elements, (el)=>{
61
61
  !0 !== el.visited && updateCss(el);
62
62
  });
@@ -65,39 +65,42 @@ function isUrlRequest(url) {
65
65
  return !!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
66
66
  }
67
67
  function cssReload(moduleId, options) {
68
+ var fn;
69
+ let timeout;
68
70
  if (noDocument) return console.log("[HMR] No `window.document` found, CSS HMR disabled"), noop;
69
- var fn, timeout, getScriptSrc = function(moduleId) {
70
- var src = srcByModuleId[moduleId];
71
+ let getScriptSrc = function(moduleId) {
72
+ let src = srcByModuleId[moduleId];
71
73
  if (!src) {
72
74
  if (document.currentScript) ({ src } = document.currentScript);
73
75
  else {
74
- var scripts = document.getElementsByTagName("script"), lastScriptTag = scripts[scripts.length - 1];
76
+ let scripts = document.getElementsByTagName("script"), lastScriptTag = scripts[scripts.length - 1];
75
77
  lastScriptTag && ({ src } = lastScriptTag);
76
78
  }
77
79
  srcByModuleId[moduleId] = src;
78
80
  }
79
81
  return (fileMap)=>{
80
82
  if (!src) return null;
81
- var splitResult = src.match(/([^\\/]+)\.js$/), filename = splitResult && splitResult[1];
83
+ let splitResult = src.match(/([^\\/]+)\.js$/), filename = splitResult && splitResult[1];
82
84
  return filename && fileMap ? fileMap.split(",").map((mapRule)=>{
83
- var reg = RegExp("".concat(filename, "\\.js$"), "g");
84
- return normalizeUrl(src.replace(reg, "".concat(mapRule.replace(/{fileName}/g, filename), ".css")));
85
+ let reg = RegExp(`${filename}\\.js$`, "g");
86
+ return normalizeUrl(src.replace(reg, `${mapRule.replace(/{fileName}/g, filename)}.css`));
85
87
  }) : [
86
88
  src.replace(".js", ".css")
87
89
  ];
88
90
  };
89
91
  }(moduleId);
90
92
  return fn = function() {
91
- var src = getScriptSrc(options.filename), reloaded = function(src) {
93
+ let src = getScriptSrc(options.filename), reloaded = function(src) {
92
94
  if (!src) return !1;
93
- var elements = document.querySelectorAll("link"), loaded = !1;
95
+ let elements = document.querySelectorAll("link"), loaded = !1;
94
96
  return forEach.call(elements, (el)=>{
95
- if (el.href) {
96
- var href, ret, normalizedHref, url = (href = el.href, ret = "", normalizedHref = normalizeUrl(href), src.some((url)=>{
97
- normalizedHref.indexOf(src) > -1 && (ret = url);
98
- }), ret);
99
- !isUrlRequest(url) || !0 !== el.visited && url && (updateCss(el, url), loaded = !0);
100
- }
97
+ var href;
98
+ let ret, normalizedHref;
99
+ if (!el.href) return;
100
+ let url = (href = el.href, ret = "", normalizedHref = normalizeUrl(href), src.some((url)=>{
101
+ normalizedHref.indexOf(src) > -1 && (ret = url);
102
+ }), ret);
103
+ !isUrlRequest(url) || !0 !== el.visited && url && (updateCss(el, url), loaded = !0);
101
104
  }), loaded;
102
105
  }(src);
103
106
  if (options.locals) {
@@ -105,9 +108,8 @@ function cssReload(moduleId, options) {
105
108
  return;
106
109
  }
107
110
  reloaded ? console.log("[HMR] CSS reload %s", src && src.join(" ")) : (console.log("[HMR] Reload all CSS"), reloadAll());
108
- }, timeout = 0, function() {
109
- for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
110
- var self = this;
111
+ }, timeout = 0, function(...args) {
112
+ let self = this;
111
113
  clearTimeout(timeout), timeout = setTimeout(function() {
112
114
  return fn.apply(self, args);
113
115
  }, 50);
package/dist/index.js CHANGED
@@ -1287,6 +1287,33 @@ for(var __webpack_i__ in (()=>{
1287
1287
  ...this
1288
1288
  };
1289
1289
  }
1290
+ }), Object.defineProperty(binding_.Chunks.prototype, "entries", {
1291
+ enumerable: !0,
1292
+ configurable: !0,
1293
+ value () {
1294
+ let chunks = this._values(), index = 0;
1295
+ return {
1296
+ [Symbol.iterator] () {
1297
+ return this;
1298
+ },
1299
+ next () {
1300
+ if (index < chunks.length) {
1301
+ let chunk = chunks[index++];
1302
+ return {
1303
+ value: [
1304
+ chunk,
1305
+ chunk
1306
+ ],
1307
+ done: !1
1308
+ };
1309
+ }
1310
+ return {
1311
+ value: void 0,
1312
+ done: !0
1313
+ };
1314
+ }
1315
+ };
1316
+ }
1290
1317
  }), Object.defineProperty(binding_.Chunks.prototype, "values", {
1291
1318
  enumerable: !0,
1292
1319
  configurable: !0,
@@ -4364,7 +4391,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4364
4391
  ])
4365
4392
  }, hooks_compilationHooksMap.set(compilation, hooks)), hooks;
4366
4393
  }, HtmlRspackPlugin.version = 5;
4367
- let IgnorePlugin = base_create(binding_.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, "compilation"), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
4394
+ let IgnorePlugin = base_create(binding_.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, "compilation"), InlineExportsPlugin = base_create(binding_.BuiltinPluginName.InlineExportsPlugin, ()=>{}, "compilation"), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
4368
4395
  class JavascriptModulesPlugin extends RspackBuiltinPlugin {
4369
4396
  name = binding_.BuiltinPluginName.JavascriptModulesPlugin;
4370
4397
  affectedHooks = "compilation";
@@ -5718,7 +5745,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5718
5745
  }, applyExperimentsDefaults = (experiments, { development })=>{
5719
5746
  F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
5720
5747
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5721
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-e28e40e9-20251022173516"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5748
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-4ad8b49f-20251023175711"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5722
5749
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5723
5750
  if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { usedExports, inlineConst, deferImport })=>{
5724
5751
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
@@ -7364,7 +7391,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7364
7391
  });
7365
7392
  }
7366
7393
  }
7367
- let CORE_VERSION = "1.6.0-canary-e28e40e9-20251022173516", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7394
+ let CORE_VERSION = "1.6.0-canary-4ad8b49f-20251023175711", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7368
7395
 
7369
7396
  Help:
7370
7397
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -8625,8 +8652,8 @@ Help:
8625
8652
  hasWarnings() {
8626
8653
  return this.stats.some((stat)=>stat.hasWarnings());
8627
8654
  }
8628
- #createChildOptions(options, context) {
8629
- let { children: childrenOptions, ...baseOptions } = "string" == typeof options ? {
8655
+ #createChildOptions(options = {}, context) {
8656
+ let { children: childrenOptions, ...baseOptions } = "string" == typeof options || "boolean" == typeof options ? {
8630
8657
  preset: options
8631
8658
  } : options, children = this.stats.map((stat, idx)=>{
8632
8659
  let childOptions = Array.isArray(childrenOptions) ? childrenOptions[idx] : childrenOptions;
@@ -8649,13 +8676,13 @@ Help:
8649
8676
  };
8650
8677
  }
8651
8678
  toJson(options) {
8652
- let childOptions = this.#createChildOptions(options || {}, {
8679
+ let childOptions = this.#createChildOptions(options, {
8653
8680
  forToString: !1
8654
8681
  }), obj = {};
8655
8682
  obj.children = this.stats.map((stat, idx)=>{
8656
8683
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8657
8684
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8658
- }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-e28e40e9-20251022173516", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8685
+ }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-4ad8b49f-20251023175711", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8659
8686
  let mapError = (j, obj)=>({
8660
8687
  ...obj,
8661
8688
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8667,7 +8694,7 @@ Help:
8667
8694
  return obj;
8668
8695
  }
8669
8696
  toString(options) {
8670
- let childOptions = this.#createChildOptions(options || {}, {
8697
+ let childOptions = this.#createChildOptions(options, {
8671
8698
  forToString: !0
8672
8699
  });
8673
8700
  return this.stats.map((stat, idx)=>{
@@ -9554,7 +9581,7 @@ Help:
9554
9581
  object.hash = context.getStatsCompilation(compilation).hash;
9555
9582
  },
9556
9583
  version: (object)=>{
9557
- object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-e28e40e9-20251022173516";
9584
+ object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-4ad8b49f-20251023175711";
9558
9585
  },
9559
9586
  env: (object, _compilation, _context, { _env })=>{
9560
9587
  object.env = _env;
@@ -10893,7 +10920,7 @@ Help:
10893
10920
  moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
10894
10921
  namespace: options.output.devtoolNamespace
10895
10922
  }).apply(compiler);
10896
- if (new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), options.experiments.css && new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.experiments.rspackFuture.bundlerInfo && new BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin().apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin("global" === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin("size" !== options.optimization.mangleExports).apply(compiler), options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) for (let type of options.output.enabledLibraryTypes)new EnableLibraryPlugin(type).apply(compiler);
10923
+ if (new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), options.experiments.css && new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.experiments.rspackFuture.bundlerInfo && new BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin().apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin("global" === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), (options.experiments.inlineConst || options.experiments.inlineEnum) && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin("size" !== options.optimization.mangleExports).apply(compiler), options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) for (let type of options.output.enabledLibraryTypes)new EnableLibraryPlugin(type).apply(compiler);
10897
10924
  options.optimization.splitChunks && new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler), options.optimization.removeEmptyChunks && new RemoveEmptyChunksPlugin().apply(compiler), options.optimization.realContentHash && new RealContentHashPlugin().apply(compiler);
10898
10925
  let moduleIds = options.optimization.moduleIds;
10899
10926
  if (moduleIds) switch(moduleIds){
@@ -11658,7 +11685,7 @@ Help:
11658
11685
  let _options = JSON.stringify(options || {});
11659
11686
  return binding_default().transform(source, _options);
11660
11687
  }
11661
- let exports_rspackVersion = "1.6.0-canary-e28e40e9-20251022173516", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11688
+ let exports_rspackVersion = "1.6.0-canary-4ad8b49f-20251023175711", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11662
11689
  getNormalizedRspackOptions: getNormalizedRspackOptions,
11663
11690
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
11664
11691
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -13,7 +13,7 @@ export interface Etag {
13
13
  toString(): string;
14
14
  }
15
15
  export type CallbackCache<T> = (err?: WebpackError | null, result?: T) => void;
16
- type GotHandler = (result: any | null, callback: (error: Error | null) => void) => void;
16
+ type GotHandler<T = any> = (result: T | null, callback: (error: Error | null) => void) => void;
17
17
  export declare class Cache {
18
18
  static STAGE_DISK: number;
19
19
  static STAGE_MEMORY: number;
@@ -61,7 +61,7 @@ export declare enum RequestType {
61
61
  export declare enum RequestSyncType {
62
62
  WaitForPendingRequest = "WaitForPendingRequest"
63
63
  }
64
- export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => Promise<any> | any;
64
+ export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => any;
65
65
  type WorkerArgs = any[];
66
66
  export type WorkerError = Error;
67
67
  export declare function serializeError(error: unknown): WorkerError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.6.0-canary-e28e40e9-20251022173516",
3
+ "version": "1.6.0-canary-4ad8b49f-20251023175711",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@ast-grep/napi": "^0.39.6",
41
41
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
42
- "@rslib/core": "0.16.0",
42
+ "@rslib/core": "0.16.1",
43
43
  "@swc/types": "0.1.25",
44
44
  "@types/node": "^20.19.23",
45
45
  "@types/watchpack": "^2.4.4",
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "@module-federation/runtime-tools": "0.21.1",
59
59
  "@rspack/lite-tapable": "1.0.1",
60
- "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-e28e40e9-20251022173516"
60
+ "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-4ad8b49f-20251023175711"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@swc/helpers": ">=0.5.1"