@rspack-canary/core 1.6.0-canary-beafb11e-20251019174144 → 1.6.0-canary-0eb13821-20251021173640

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.
@@ -107,6 +107,14 @@ declare class Compiler {
107
107
  cache: Cache;
108
108
  compilerPath: string;
109
109
  options: RspackOptionsNormalized;
110
+ /**
111
+ * Whether to skip dropping Rust compiler instance to improve performance.
112
+ * This is an internal option api and could be removed or changed at any time.
113
+ * @internal
114
+ * true: Skip dropping Rust compiler instance.
115
+ * false: Drop Rust compiler instance when Compiler is garbage collected.
116
+ */
117
+ unsafeFastDrop: boolean;
110
118
  /**
111
119
  * Note: This is not a webpack public API, maybe removed in future.
112
120
  * @internal
@@ -41,6 +41,7 @@ export declare class MultiCompiler {
41
41
  running: boolean;
42
42
  watching?: MultiWatching;
43
43
  constructor(compilers: Compiler[] | Record<string, Compiler>, options?: MultiCompilerOptions);
44
+ set unsafeFastDrop(value: boolean);
44
45
  get options(): import(".").RspackOptionsNormalized[] & MultiCompilerOptions;
45
46
  get outputPath(): string;
46
47
  get inputFileSystem(): InputFileSystem;
@@ -321,5 +321,8 @@ export declare const RuntimeGlobals: {
321
321
  * ) =\> void
322
322
  */
323
323
  readonly asyncModule: "__webpack_require__.a";
324
+ readonly asyncModuleExportSymbol: "__webpack_require__.aE";
325
+ readonly makeDeferredNamespaceObject: "__webpack_require__.z";
326
+ readonly makeDeferredNamespaceObjectSymbol: "__webpack_require__.zS";
324
327
  };
325
328
  export declare const isReservedRuntimeGlobal: (r: string) => boolean;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Watching.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
1
10
  import type { Callback } from "@rspack/lite-tapable";
2
11
  import type { Compiler } from ".";
3
12
  import { Stats } from ".";
@@ -1,5 +1,11 @@
1
1
  import type { Compiler } from "../Compiler";
2
2
  export declare class EsmLibraryPlugin {
3
3
  static PLUGIN_NAME: string;
4
+ options?: {
5
+ preserveModules?: string;
6
+ };
7
+ constructor(options?: {
8
+ preserveModules?: string;
9
+ });
4
10
  apply(compiler: Compiler): void;
5
11
  }
@@ -1,12 +1,3 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/defaults.js
4
- *
5
- * MIT Licensed
6
- * Author Tobias Koppers @sokra
7
- * Copyright (c) JS Foundation and other contributors
8
- * https://github.com/webpack/webpack/blob/main/LICENSE
9
- */
10
1
  import type { RspackOptionsNormalized } from "./normalization";
11
2
  export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => void;
12
3
  export declare const applyRspackOptionsBaseDefaults: (options: RspackOptionsNormalized) => void;
@@ -76,6 +76,7 @@ export interface ModuleOptionsNormalized {
76
76
  parser: ParserOptionsByModuleType;
77
77
  generator: GeneratorOptionsByModuleType;
78
78
  noParse?: NoParseOption;
79
+ unsafeCache?: boolean | RegExp;
79
80
  }
80
81
  export type ExperimentCacheNormalized = boolean | {
81
82
  type: "memory";
@@ -121,6 +122,7 @@ export interface ExperimentsNormalized {
121
122
  typeReexportsPresence?: boolean;
122
123
  lazyBarrel?: boolean;
123
124
  nativeWatcher?: boolean;
125
+ deferImport?: boolean;
124
126
  }
125
127
  export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
126
128
  export type OptimizationRuntimeChunkNormalized = false | {
@@ -818,6 +818,8 @@ export type JavascriptParserOptions = {
818
818
  typeReexportsPresence?: "no-tolerant" | "tolerant" | "tolerant-no-check";
819
819
  /** Whether to enable JSX parsing */
820
820
  jsx?: boolean;
821
+ /** Whether to enable defer import */
822
+ deferImport?: boolean;
821
823
  };
822
824
  export type JsonParserOptions = {
823
825
  /**
@@ -990,6 +992,10 @@ export type ModuleOptions = {
990
992
  generator?: GeneratorOptionsByModuleType;
991
993
  /** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
992
994
  noParse?: NoParseOption;
995
+ /**
996
+ * Cache the resolving of module requests.
997
+ */
998
+ unsafeCache?: boolean | RegExp;
993
999
  };
994
1000
  type AllowTarget = "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "node" | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}`;
995
1001
  /** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
@@ -2116,6 +2122,11 @@ export type Experiments = {
2116
2122
  * @default false
2117
2123
  */
2118
2124
  lazyBarrel?: boolean;
2125
+ /**
2126
+ * Enable defer import feature
2127
+ * @default false
2128
+ */
2129
+ deferImport?: boolean;
2119
2130
  };
2120
2131
  export type Watch = boolean;
2121
2132
  /** Options for watch mode. */
@@ -2148,8 +2159,7 @@ export type WatchOptions = {
2148
2159
  /**
2149
2160
  * Options for devServer, it based on `webpack-dev-server@5`
2150
2161
  * */
2151
- export interface DevServer extends DevServerOptions {
2152
- }
2162
+ export type DevServer = DevServerOptions;
2153
2163
  export type { Middleware as DevServerMiddleware } from "./devServer";
2154
2164
  /**
2155
2165
  * Ignore specific warnings.
package/dist/index.js CHANGED
@@ -220,6 +220,9 @@ var __webpack_modules__ = {
220
220
  "@rspack/binding": function(module1) {
221
221
  module1.exports = require(process.env.RSPACK_BINDING ? process.env.RSPACK_BINDING : "@rspack/binding");
222
222
  },
223
+ "node:crypto": function(module1) {
224
+ module1.exports = require("node:crypto");
225
+ },
223
226
  "node:http": function(module1) {
224
227
  module1.exports = require("node:http");
225
228
  },
@@ -250,6 +253,11 @@ var __webpack_modules__ = {
250
253
  module1.exports = import("node:inspector").then(function(module1) {
251
254
  return module1;
252
255
  });
256
+ },
257
+ "node:worker_threads": function(module1) {
258
+ module1.exports = import("node:worker_threads").then(function(module1) {
259
+ return module1;
260
+ });
253
261
  }
254
262
  }, __webpack_module_cache__ = {};
255
263
  function __webpack_require__(moduleId) {
@@ -436,10 +444,7 @@ for(var __webpack_i__ in (()=>{
436
444
  let stacks = stack.split("\n");
437
445
  for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
438
446
  return stacks.join("\n");
439
- })(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
440
- cutOffLoaderExecution(stack);
441
- return cutOffMessage(stack, name, message);
442
- }, cutOffMessage = (stack, name, message)=>{
447
+ })(stack, "LOADER_EXECUTION"), cutOffMessage = (stack, name, message)=>{
443
448
  let nextLine = stack.indexOf("\n");
444
449
  return -1 === nextLine ? stack === message ? "" : stack : stack.slice(0, nextLine) === `${name}: ${message}` ? stack.slice(nextLine + 1) : stack;
445
450
  }, external_node_util_namespaceObject = require("node:util");
@@ -2139,8 +2144,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2139
2144
  context,
2140
2145
  entries,
2141
2146
  name: options.name
2142
- })), DllReferenceAgencyPlugin = base_create(binding_.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options), external_node_assert_namespaceObject = require("node:assert");
2143
- var external_node_assert_default = __webpack_require__.n(external_node_assert_namespaceObject);
2147
+ })), DllReferenceAgencyPlugin = base_create(binding_.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options);
2144
2148
  class EntryOptionPlugin {
2145
2149
  apply(compiler) {
2146
2150
  compiler.hooks.entryOption.tap("EntryOptionPlugin", (context, entry)=>(EntryOptionPlugin.applyEntryOption(compiler, context, entry), !0));
@@ -2149,7 +2153,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2149
2153
  if ("function" == typeof entry) new DynamicEntryPlugin(context, entry).apply(compiler);
2150
2154
  else for (let name of Object.keys(entry)){
2151
2155
  let desc = entry[name], options = EntryOptionPlugin.entryDescriptionToOptions(compiler, name, desc);
2152
- for (let entry of (external_node_assert_default()(void 0 !== desc.import, "desc.import should not be `undefined` once `EntryOptionPlugin.applyEntryOption` is called"), desc.import))new EntryPlugin(context, entry, options).apply(compiler);
2156
+ if (void 0 === desc.import) throw Error("desc.import should not be `undefined` once `EntryOptionPlugin.applyEntryOption` is called");
2157
+ for (let entry of desc.import)new EntryPlugin(context, entry, options).apply(compiler);
2153
2158
  }
2154
2159
  }
2155
2160
  static entryDescriptionToOptions(compiler, name, desc) {
@@ -2262,6 +2267,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2262
2267
  let EnableWasmLoadingPlugin = base_create(binding_.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type), EnsureChunkConditionsPlugin = base_create(binding_.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{}), RemoveDuplicateModulesPlugin = base_create(binding_.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({}));
2263
2268
  class EsmLibraryPlugin {
2264
2269
  static PLUGIN_NAME = "EsmLibraryPlugin";
2270
+ options;
2271
+ constructor(options){
2272
+ this.options = options;
2273
+ }
2265
2274
  apply(compiler) {
2266
2275
  var config;
2267
2276
  let err;
@@ -2270,7 +2279,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2270
2279
  if (splitChunks && (splitChunks.chunks = "all", splitChunks.minSize = 0), err = (config = compiler.options).optimization.concatenateModules ? "You should disable `config.optimization.concatenateModules`" : !1 !== config.output.chunkFormat ? "You should disable default chunkFormat by `config.output.chunkFormat = false`" : void 0) throw new src_0.WebpackError(`Conflicted config for ${EsmLibraryPlugin.PLUGIN_NAME}: ${err}`);
2271
2280
  compiler.__internal__registerBuiltinPlugin({
2272
2281
  name: binding_.BuiltinPluginName.EsmLibraryPlugin,
2273
- options: {}
2282
+ options: {
2283
+ preserveModules: this.options?.preserveModules
2284
+ }
2274
2285
  });
2275
2286
  }
2276
2287
  }
@@ -2705,8 +2716,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2705
2716
  });
2706
2717
  }
2707
2718
  }
2708
- let external_node_crypto_namespaceObject = require("node:crypto");
2709
- var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject);
2710
2719
  let CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
2711
2720
  function createMessage(method) {
2712
2721
  return `Abstract method${method ? ` ${method}` : ""}. Must be overridden.`;
@@ -2865,7 +2874,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2865
2874
  return encoding ? this.wasmHash.digest(encoding) : this.wasmHash.digest();
2866
2875
  }
2867
2876
  }
2868
- let createHash = (algorithm)=>{
2877
+ let createHash_createHash = (algorithm)=>{
2869
2878
  if ("function" == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
2870
2879
  switch(algorithm){
2871
2880
  case "debug":
@@ -2887,9 +2896,15 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2887
2896
  return createMd4();
2888
2897
  })());
2889
2898
  case "native-md4":
2890
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
2899
+ return new BulkUpdateDecorator(()=>{
2900
+ let { createHash } = __webpack_require__("node:crypto");
2901
+ return createHash("md4");
2902
+ }, "md4");
2891
2903
  default:
2892
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash(algorithm), algorithm);
2904
+ return new BulkUpdateDecorator(()=>{
2905
+ let { createHash } = __webpack_require__("node:crypto");
2906
+ return createHash(algorithm);
2907
+ }, algorithm);
2893
2908
  }
2894
2909
  }, memoize = (fn)=>{
2895
2910
  let result, cache = !1, callback = fn;
@@ -2897,22 +2912,26 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2897
2912
  }, memoizeFn = (fn)=>{
2898
2913
  let cache = null;
2899
2914
  return (...args)=>(cache || (cache = fn()), cache(...args));
2915
+ }, ModuleError_createMessage = (err, type, from)=>{
2916
+ let message = `Module ${type}${from ? ` (from ${from}):\n` : ": "}`;
2917
+ return err && "object" == typeof err && err.message ? message += err.message : err && (message += err), message;
2918
+ }, getErrorDetails = (err)=>{
2919
+ var stack, name, message;
2920
+ return err && "object" == typeof err && err.stack ? (stack = err.stack, name = err.name, message = err.message, cutOffLoaderExecution(stack), cutOffMessage(stack, name, message)) : void 0;
2900
2921
  };
2901
2922
  class ModuleError extends WebpackError {
2902
2923
  error;
2903
2924
  constructor(err, { from } = {}){
2904
- let message = "Module Error";
2905
- from ? message += ` (from ${from}):\n` : message += ": ", err && "object" == typeof err && err.message ? message += err.message : err && (message += err), super(message), this.name = "ModuleError", this.error = err, this.details = err && "object" == typeof err && err.stack ? cleanUp(err.stack, err.name, err.message) : void 0;
2925
+ super(ModuleError_createMessage(err, "Error", from)), this.name = "ModuleError", this.error = err, this.details = getErrorDetails(err);
2906
2926
  }
2907
2927
  }
2908
2928
  class ModuleWarning extends WebpackError {
2909
2929
  error;
2910
2930
  constructor(err, { from } = {}){
2911
- let message = "Module Warning";
2912
- from ? message += ` (from ${from}):\n` : message += ": ", err && "object" == typeof err && err.message ? message += err.message : err && (message += err), super(message), this.name = "ModuleWarning", this.error = err, this.details = err && "object" == typeof err && err.stack ? cleanUp(err.stack, err.name, err.message) : void 0;
2931
+ super(ModuleError_createMessage(err, "Warning", from)), this.name = "ModuleWarning", this.error = err, this.details = getErrorDetails(err);
2913
2932
  }
2914
2933
  }
2915
- let external_node_worker_threads_namespaceObject = require("node:worker_threads"), ensureLoaderWorkerPool = async ()=>service_pool || (service_pool = Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "tinypool")).then(({ Tinypool })=>{
2934
+ let ensureLoaderWorkerPool = async ()=>service_pool || (service_pool = Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "tinypool")).then(({ Tinypool })=>{
2916
2935
  let availableThreads = Math.max(__webpack_require__("node:os").cpus().length - 1, 1);
2917
2936
  return new Tinypool({
2918
2937
  filename: external_node_path_default().resolve(__dirname, "worker.js"),
@@ -2936,7 +2955,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2936
2955
  throw Error("Failed to serialize error, only string, Error instances and objects with a message property are supported");
2937
2956
  }
2938
2957
  let service_run = async (loaderName, task, options)=>ensureLoaderWorkerPool().then(async (pool)=>{
2939
- let { port1: mainPort, port2: workerPort } = new external_node_worker_threads_namespaceObject.MessageChannel(), { port1: mainSyncPort, port2: workerSyncPort } = new external_node_worker_threads_namespaceObject.MessageChannel();
2958
+ let { MessageChannel } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:worker_threads")), { port1: mainPort, port2: workerPort } = new MessageChannel(), { port1: mainSyncPort, port2: workerSyncPort } = new MessageChannel();
2940
2959
  return new Promise((resolve, reject)=>{
2941
2960
  let handleError = (error)=>{
2942
2961
  mainPort.close(), mainSyncPort.close(), reject(error);
@@ -3128,16 +3147,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3128
3147
  return this.loaderItem.pitchExecuted;
3129
3148
  }
3130
3149
  set pitchExecuted(value) {
3131
- external_node_assert_default()(value), this.loaderItem.pitchExecuted = !0;
3150
+ if (!value) throw Error("pitchExecuted should be true");
3151
+ this.loaderItem.pitchExecuted = !0;
3132
3152
  }
3133
3153
  get normalExecuted() {
3134
3154
  return this.loaderItem.normalExecuted;
3135
3155
  }
3136
3156
  set normalExecuted(value) {
3137
- external_node_assert_default()(value), this.loaderItem.normalExecuted = !0;
3157
+ if (!value) throw Error("normalExecuted should be true");
3158
+ this.loaderItem.normalExecuted = !0;
3138
3159
  }
3139
3160
  set noPitch(value) {
3140
- external_node_assert_default()(value), this.loaderItem.noPitch = !0;
3161
+ if (!value) throw Error("noPitch should be true");
3162
+ this.loaderItem.noPitch = !0;
3141
3163
  }
3142
3164
  shouldYield() {
3143
3165
  return this.request.startsWith(BUILTIN_LOADER_PREFIX);
@@ -3337,7 +3359,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3337
3359
  loaderContext.utils = {
3338
3360
  absolutify: (context, request)=>context === contextDirectory ? getAbsolutifyInContext()(request) : getAbsolutify()(context, request),
3339
3361
  contextify: (context, request)=>context === contextDirectory ? getContextifyInContext()(request) : getContextify()(context, request),
3340
- createHash: (type)=>createHash(type || compiler._lastCompilation.outputOptions.hashFunction)
3362
+ createHash: (type)=>createHash_createHash(type || compiler._lastCompilation.outputOptions.hashFunction)
3341
3363
  }, loaderContext._compiler = compiler, loaderContext._compilation = compiler._lastCompilation, loaderContext._module = context._module, loaderContext.getOptions = ()=>{
3342
3364
  let loader = getCurrentLoader(loaderContext), options = loader?.options;
3343
3365
  if ("string" == typeof options) if (options.startsWith("{") && options.endsWith("}")) try {
@@ -3744,7 +3766,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3744
3766
  ]));
3745
3767
  }(resolve.extensionAlias),
3746
3768
  tsconfig: function(tsConfig) {
3747
- if (external_node_assert_default()("string" != typeof tsConfig, "should resolve string tsConfig in normalization"), void 0 === tsConfig) return tsConfig;
3769
+ if ("string" == typeof tsConfig) throw Error("should resolve string tsConfig in normalization");
3770
+ if (void 0 === tsConfig) return tsConfig;
3748
3771
  let { configFile, references } = tsConfig;
3749
3772
  return {
3750
3773
  configFile,
@@ -3938,7 +3961,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3938
3961
  commonjsMagicComments: parser.commonjsMagicComments,
3939
3962
  inlineConst: parser.inlineConst,
3940
3963
  typeReexportsPresence: parser.typeReexportsPresence,
3941
- jsx: parser.jsx
3964
+ jsx: parser.jsx,
3965
+ deferImport: parser.deferImport
3942
3966
  };
3943
3967
  }
3944
3968
  function getRawCssParserOptions(parser) {
@@ -4599,7 +4623,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4599
4623
  ...passThrough
4600
4624
  };
4601
4625
  }(this.options, compiler);
4602
- return external_node_assert_default()(void 0 !== rawOptions), createBuiltinPlugin(this.name, rawOptions);
4626
+ if (void 0 === rawOptions) throw Error("rawOptions should not be undefined");
4627
+ return createBuiltinPlugin(this.name, rawOptions);
4603
4628
  }
4604
4629
  }
4605
4630
  let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
@@ -4651,7 +4676,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4651
4676
  for (let tag of headTags.concat(bodyTags))this.processTag(tag, publicPath, outputPath, crossOriginLoading);
4652
4677
  }
4653
4678
  processTag(tag, publicPath, outputPath, crossOriginLoading) {
4654
- var hashFuncNames, source;
4655
4679
  if (tag.attributes && "integrity" in tag.attributes) return;
4656
4680
  let tagSrc = function(tag) {
4657
4681
  if (tag.attributes) {
@@ -4665,7 +4689,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4665
4689
  }(tag);
4666
4690
  if (!tagSrc) return;
4667
4691
  let src = (0, external_node_path_namespaceObject.relative)(publicPath, decodeURIComponent(tagSrc));
4668
- tag.attributes.integrity = this.getIntegrityChecksumForAsset(src) || (hashFuncNames = this.options.hashFuncNames, source = (0, external_node_fs_namespaceObject.readFileSync)((0, external_node_path_namespaceObject.join)(outputPath, src)), hashFuncNames.map((hashFuncName)=>`${hashFuncName}-${(0, external_node_crypto_namespaceObject.createHash)(hashFuncName).update("string" == typeof source ? Buffer.from(source, "utf-8") : source).digest("base64")}`).join(" ")), tag.attributes.crossorigin = crossOriginLoading || "anonymous";
4692
+ tag.attributes.integrity = this.getIntegrityChecksumForAsset(src) || function(hashFuncNames, source) {
4693
+ let { createHash } = __webpack_require__("node:crypto");
4694
+ return hashFuncNames.map((hashFuncName)=>`${hashFuncName}-${createHash(hashFuncName).update("string" == typeof source ? Buffer.from(source, "utf-8") : source).digest("base64")}`).join(" ");
4695
+ }(this.options.hashFuncNames, (0, external_node_fs_namespaceObject.readFileSync)((0, external_node_path_namespaceObject.join)(outputPath, src))), tag.attributes.crossorigin = crossOriginLoading || "anonymous";
4669
4696
  }
4670
4697
  apply(compiler) {
4671
4698
  if (this.isEnabled(compiler) && (super.apply(compiler), compiler.hooks.compilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
@@ -5620,7 +5647,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5620
5647
  let targets, context;
5621
5648
  F(options, "context", ()=>process.cwd()), F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
5622
5649
  let { mode, target } = options;
5623
- external_node_assert_default()(!isNil(target));
5650
+ if (isNil(target)) throw Error("target should not be nil after defaults");
5624
5651
  let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
5625
5652
  let keys = new Set();
5626
5653
  for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
@@ -5650,13 +5677,15 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5650
5677
  }), applySnapshotDefaults(options.snapshot, {
5651
5678
  production
5652
5679
  }), applyModuleDefaults(options.module, {
5680
+ cache: !!options.cache,
5653
5681
  asyncWebAssembly: options.experiments.asyncWebAssembly,
5654
5682
  css: options.experiments.css,
5655
5683
  targetProperties,
5656
5684
  mode: options.mode,
5657
5685
  uniqueName: options.output.uniqueName,
5658
5686
  usedExports: !!options.optimization.usedExports,
5659
- inlineConst: options.experiments.inlineConst
5687
+ inlineConst: options.experiments.inlineConst,
5688
+ deferImport: options.experiments.deferImport
5660
5689
  }), applyOutputDefaults(options.output, {
5661
5690
  context: options.context,
5662
5691
  targetProperties,
@@ -5687,17 +5716,18 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5687
5716
  let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
5688
5717
  D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
5689
5718
  }, applyExperimentsDefaults = (experiments, { development })=>{
5690
- 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, "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);
5719
+ 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);
5691
5720
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5692
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-beafb11e-20251019174144"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5693
- }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst })=>{
5694
- if (assertNotNill(module1.parser), assertNotNill(module1.generator), 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 })=>{
5721
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-0eb13821-20251021173640"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5722
+ }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5723
+ 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 })=>{
5695
5724
  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", [
5696
5725
  "..."
5697
- ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", usedExports && inlineConst), D(parserOptions, "typeReexportsPresence", "no-tolerant"), D(parserOptions, "jsx", !1);
5726
+ ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", usedExports && inlineConst), D(parserOptions, "typeReexportsPresence", "no-tolerant"), D(parserOptions, "jsx", !1), D(parserOptions, "deferImport", deferImport);
5698
5727
  })(module1.parser.javascript, {
5699
5728
  usedExports,
5700
- inlineConst
5729
+ inlineConst,
5730
+ deferImport
5701
5731
  }), F(module1.parser, "json", ()=>({})), assertNotNill(module1.parser.json), D(module1.parser.json, "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module1.generator, "json", ()=>({})), assertNotNill(module1.generator.json), D(module1.generator.json, "JSONParse", !0), css) {
5702
5732
  F(module1.parser, "css", ()=>({})), assertNotNill(module1.parser.css), D(module1.parser.css, "namedExports", !0), D(module1.parser.css, "url", !0), F(module1.parser, "css/auto", ()=>({})), assertNotNill(module1.parser["css/auto"]), D(module1.parser["css/auto"], "namedExports", !0), D(module1.parser["css/auto"], "url", !0), F(module1.parser, "css/module", ()=>({})), assertNotNill(module1.parser["css/module"]), D(module1.parser["css/module"], "namedExports", !0), D(module1.parser["css/module"], "url", !0), F(module1.generator, "css", ()=>({})), assertNotNill(module1.generator.css), D(module1.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module1.generator.css, "esModule", !0), F(module1.generator, "css/auto", ()=>({})), assertNotNill(module1.generator["css/auto"]), D(module1.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module1.generator["css/auto"], "exportsConvention", "as-is");
5703
5733
  let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
@@ -6256,7 +6286,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6256
6286
  ]),
6257
6287
  rules: nestedArray(module1.rules, (r)=>[
6258
6288
  ...r
6259
- ])
6289
+ ]),
6290
+ unsafeCache: module1.unsafeCache
6260
6291
  })),
6261
6292
  target: config.target,
6262
6293
  externals: config.externals,
@@ -6590,7 +6621,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6590
6621
  let count = files.length;
6591
6622
  if (0 === count) fs.rmdir(p, callback);
6592
6623
  else for (let file of files){
6593
- external_node_assert_default()("string" == typeof file);
6624
+ if ("string" != typeof file) throw Error("file should be a string");
6594
6625
  let fullPath = join(fs, p, file);
6595
6626
  rmrf(fs, fullPath, (err)=>{
6596
6627
  if (err) return callback(err);
@@ -6743,7 +6774,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6743
6774
  }
6744
6775
  toString() {
6745
6776
  if (void 0 === this._hash) {
6746
- let hash = createHash(this._hashFunction);
6777
+ let hash = createHash_createHash(this._hashFunction);
6747
6778
  this._obj.updateHash(hash), this._hash = hash.digest("base64");
6748
6779
  }
6749
6780
  return this._hash;
@@ -7074,7 +7105,10 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7074
7105
  systemContext: "__webpack_require__.y",
7075
7106
  baseURI: "__webpack_require__.b",
7076
7107
  relativeUrl: "__webpack_require__.U",
7077
- asyncModule: "__webpack_require__.a"
7108
+ asyncModule: "__webpack_require__.a",
7109
+ asyncModuleExportSymbol: "__webpack_require__.aE",
7110
+ makeDeferredNamespaceObject: "__webpack_require__.z",
7111
+ makeDeferredNamespaceObjectSymbol: "__webpack_require__.zS"
7078
7112
  };
7079
7113
  for (let entry of Object.entries(RuntimeGlobals))RESERVED_RUNTIME_GLOBALS.set(entry[1], entry[0]);
7080
7114
  class CodeGenerationResult {
@@ -7330,7 +7364,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7330
7364
  });
7331
7365
  }
7332
7366
  }
7333
- let CORE_VERSION = "1.6.0-canary-beafb11e-20251019174144", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7367
+ let CORE_VERSION = "1.6.0-canary-0eb13821-20251021173640", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7334
7368
 
7335
7369
  Help:
7336
7370
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -7553,7 +7587,8 @@ Help:
7553
7587
  for (let cb of (this.compiler.hooks.failed.call(err), this.handler(err, stats), cbs || this.callbacks.splice(0)))cb(err);
7554
7588
  };
7555
7589
  if (error) return handleError(error);
7556
- if (external_node_assert_default()(compilation), stats = new Stats(compilation), this.invalid && !this.suspended && !this.blocked && !(this.isBlocked() && (this.blocked = !0))) return void this.#go();
7590
+ if (!compilation) throw Error("compilation is required if no error");
7591
+ if (stats = new Stats(compilation), this.invalid && !this.suspended && !this.blocked && !(this.isBlocked() && (this.blocked = !0))) return void this.#go();
7557
7592
  let startTime = this.startTime;
7558
7593
  this.startTime = void 0, compilation.startTime = startTime, compilation.endTime = Date.now();
7559
7594
  let cbs = this.callbacks;
@@ -7630,6 +7665,7 @@ Help:
7630
7665
  cache;
7631
7666
  compilerPath;
7632
7667
  options;
7668
+ unsafeFastDrop = !1;
7633
7669
  __internal_browser_require;
7634
7670
  constructor(context, options){
7635
7671
  this.#initial = !0, this.#builtinPlugins = [], this.#nonSkippableRegisters = [], this.#moduleExecutionResultsMap = new Map(), this.#ruleSet = new RuleSetCompiler(), this.hooks = {
@@ -7867,10 +7903,7 @@ Help:
7867
7903
  }) : this.hooks.shutdown.callAsync((err)=>{
7868
7904
  if (err) return callback(err);
7869
7905
  this.cache.shutdown(()=>{
7870
- this.#getInstance((error, instance)=>{
7871
- if (error) return callback(error);
7872
- instance.close(), callback();
7873
- });
7906
+ this.#instance?.close(), callback();
7874
7907
  });
7875
7908
  });
7876
7909
  }
@@ -7910,11 +7943,11 @@ Help:
7910
7943
  return this.#compilationParams = params, params;
7911
7944
  }
7912
7945
  #getInstance(callback) {
7913
- var options, compiler, output, module1, options1, parser, generator, stats;
7946
+ var options, compiler, output, stats;
7914
7947
  let mode, experiments, error = CORE_VERSION === binding_default().EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_default().EXPECTED_RSPACK_CORE_VERSION));
7915
7948
  if (error) return callback(error);
7916
7949
  if (this.#instance) return callback(null, this.#instance);
7917
- let { options: options2 } = this, rawOptions = (options = options2, compiler = this, mode = options.mode, experiments = options.experiments, {
7950
+ let { options: options1 } = this, rawOptions = (options = options1, compiler = this, mode = options.mode, experiments = options.experiments, {
7918
7951
  name: options.name,
7919
7952
  mode,
7920
7953
  context: options.context,
@@ -7940,29 +7973,34 @@ Help:
7940
7973
  },
7941
7974
  resolve: getRawResolve(options.resolve),
7942
7975
  resolveLoader: getRawResolve(options.resolveLoader),
7943
- module: (module1 = options.module, options1 = {
7976
+ module: function(module1, options) {
7977
+ var parser, generator;
7978
+ if (isNil(module1.defaultRules)) throw Error("module.defaultRules should not be nil after defaults");
7979
+ return {
7980
+ rules: [
7981
+ {
7982
+ rules: module1.defaultRules
7983
+ },
7984
+ {
7985
+ rules: module1.rules
7986
+ }
7987
+ ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options, "javascript/auto")),
7988
+ parser: Object.fromEntries(Object.entries(parser = module1.parser).map(([k, v])=>[
7989
+ k,
7990
+ getRawParserOptions(v, k)
7991
+ ]).filter(([k, v])=>void 0 !== v)),
7992
+ generator: Object.fromEntries(Object.entries(generator = module1.generator).map(([k, v])=>[
7993
+ k,
7994
+ getRawGeneratorOptions(v, k)
7995
+ ]).filter(([k, v])=>void 0 !== v)),
7996
+ noParse: module1.noParse,
7997
+ unsafeCache: module1.unsafeCache
7998
+ };
7999
+ }(options.module, {
7944
8000
  compiler,
7945
8001
  mode,
7946
8002
  context: options.context,
7947
8003
  experiments
7948
- }, external_node_assert_default()(!isNil(module1.defaultRules), "module.defaultRules should not be nil after defaults"), {
7949
- rules: [
7950
- {
7951
- rules: module1.defaultRules
7952
- },
7953
- {
7954
- rules: module1.rules
7955
- }
7956
- ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
7957
- parser: Object.fromEntries(Object.entries(parser = module1.parser).map(([k, v])=>[
7958
- k,
7959
- getRawParserOptions(v, k)
7960
- ]).filter(([k, v])=>void 0 !== v)),
7961
- generator: Object.fromEntries(Object.entries(generator = module1.generator).map(([k, v])=>[
7962
- k,
7963
- getRawGeneratorOptions(v, k)
7964
- ]).filter(([k, v])=>void 0 !== v)),
7965
- noParse: module1.noParse
7966
8004
  }),
7967
8005
  optimization: options.optimization,
7968
8006
  stats: {
@@ -7981,11 +8019,14 @@ Help:
7981
8019
  },
7982
8020
  experiments,
7983
8021
  node: function(node) {
7984
- if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
7985
- dirname: String(node.__dirname),
7986
- filename: String(node.__filename),
7987
- global: String(node.global)
7988
- };
8022
+ if (!1 !== node) {
8023
+ if (isNil(node.__dirname) || isNil(node.global) || isNil(node.__filename)) throw Error("node.__dirname, node.global, node.__filename should not be nil");
8024
+ return {
8025
+ dirname: String(node.__dirname),
8026
+ filename: String(node.__filename),
8027
+ global: String(node.global)
8028
+ };
8029
+ }
7989
8030
  }(options.node),
7990
8031
  profile: options.profile,
7991
8032
  amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
@@ -7995,9 +8036,9 @@ Help:
7995
8036
  rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
7996
8037
  let instanceBinding = __webpack_require__("@rspack/binding");
7997
8038
  this.#registers = this.#createHooksRegisters();
7998
- let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options2.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
8039
+ let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options1.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
7999
8040
  try {
8000
- this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory)), callback(null, this.#instance);
8041
+ this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop), callback(null, this.#instance);
8001
8042
  } catch (err) {
8002
8043
  err instanceof Error && delete err.stack, callback(Error("Failed to create Rspack compiler instance, check the Rspack configuration.", {
8003
8044
  cause: err
@@ -8219,7 +8260,7 @@ Help:
8219
8260
  return function(chunk) {
8220
8261
  let digestResult;
8221
8262
  if (!getCompiler2().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
8222
- let hash = createHash(getCompiler2().options.output.hashFunction);
8263
+ let hash = createHash_createHash(getCompiler2().options.output.hashFunction);
8223
8264
  return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler2().options.output.hashDigest ? hash.digest(getCompiler2().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
8224
8265
  };
8225
8266
  }),
@@ -8341,7 +8382,7 @@ Help:
8341
8382
  return function(chunk) {
8342
8383
  let digestResult;
8343
8384
  if (!getCompiler5().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
8344
- let hash = createHash(getCompiler5().options.output.hashFunction);
8385
+ let hash = createHash_createHash(getCompiler5().options.output.hashFunction);
8345
8386
  return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler5().options.output.hashDigest ? hash.digest(getCompiler5().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
8346
8387
  };
8347
8388
  })
@@ -8614,7 +8655,7 @@ Help:
8614
8655
  obj.children = this.stats.map((stat, idx)=>{
8615
8656
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8616
8657
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8617
- }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-beafb11e-20251019174144", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8658
+ }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-0eb13821-20251021173640", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8618
8659
  let mapError = (j, obj)=>({
8619
8660
  ...obj,
8620
8661
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8763,6 +8804,9 @@ Help:
8763
8804
  });
8764
8805
  }
8765
8806
  }
8807
+ set unsafeFastDrop(value) {
8808
+ for (let compiler of this.compilers)compiler.unsafeFastDrop = value;
8809
+ }
8766
8810
  get options() {
8767
8811
  return Object.assign(this.compilers.map((c)=>c.options), this._options);
8768
8812
  }
@@ -9111,15 +9155,13 @@ Help:
9111
9155
  errors: result,
9112
9156
  filtered
9113
9157
  };
9114
- }, GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/, GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/, ITEM_NAMES = {
9158
+ }, GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/, GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/, SHARED_ITEM_NAMES = {
9115
9159
  "compilation.children[]": "compilation",
9116
9160
  "compilation.modules[]": "module",
9117
9161
  "compilation.entrypoints[]": "chunkGroup",
9118
9162
  "compilation.namedChunkGroups[]": "chunkGroup",
9119
9163
  "compilation.errors[]": "error",
9120
- "compilation.warnings[]": "warning",
9121
9164
  "chunk.modules[]": "module",
9122
- "chunk.rootModules[]": "module",
9123
9165
  "chunk.origins[]": "chunkOrigin",
9124
9166
  "compilation.chunks[]": "chunk",
9125
9167
  "compilation.assets[]": "asset",
@@ -9127,7 +9169,11 @@ Help:
9127
9169
  "module.issuerPath[]": "moduleIssuer",
9128
9170
  "module.reasons[]": "moduleReason",
9129
9171
  "module.modules[]": "module",
9130
- "module.children[]": "module",
9172
+ "module.children[]": "module"
9173
+ }, ITEM_NAMES = {
9174
+ ...SHARED_ITEM_NAMES,
9175
+ "compilation.warnings[]": "warning",
9176
+ "chunk.rootModules[]": "module",
9131
9177
  "moduleTrace[]": "moduleTraceItem"
9132
9178
  }, MERGER = {
9133
9179
  "compilation.entrypoints": mergeToObject,
@@ -9490,7 +9536,7 @@ Help:
9490
9536
  }
9491
9537
  let newEntry = {
9492
9538
  type,
9493
- message: entry.args && entry.args.length > 0 ? external_node_util_namespaceObject.format(entry.args[0], ...entry.args.slice(1)) : "",
9539
+ message: entry.args?.length ? external_node_util_namespaceObject.format(entry.args[0], ...entry.args.slice(1)) : "",
9494
9540
  trace: loggingTrace ? entry.trace : void 0,
9495
9541
  children: type === LogType.group || type === LogType.groupCollapsed ? [] : void 0
9496
9542
  };
@@ -9508,7 +9554,7 @@ Help:
9508
9554
  object.hash = context.getStatsCompilation(compilation).hash;
9509
9555
  },
9510
9556
  version: (object)=>{
9511
- object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-beafb11e-20251019174144";
9557
+ object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-0eb13821-20251021173640";
9512
9558
  },
9513
9559
  env: (object, _compilation, _context, { _env })=>{
9514
9560
  object.env = _env;
@@ -9545,8 +9591,13 @@ Help:
9545
9591
  depItem && (assets.delete(depItem), depItem.type = type, item.related = item.related || [], item.related.push(depItem));
9546
9592
  }
9547
9593
  }
9548
- object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
9549
- let limited = spaceLimited(factory.create(`${type}.assets`, Array.from(assets), {
9594
+ object.assetsByChunkName = Object.fromEntries(assetsByChunkName.map(({ name, files })=>[
9595
+ name,
9596
+ files
9597
+ ]));
9598
+ let limited = spaceLimited(factory.create(`${type}.assets`, [
9599
+ ...assets
9600
+ ], {
9550
9601
  ...context
9551
9602
  }), options.assetsSpace ?? 1 / 0);
9552
9603
  object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
@@ -9676,12 +9727,11 @@ Help:
9676
9727
  let { commonAttributes } = module1;
9677
9728
  object.source = commonAttributes.source;
9678
9729
  },
9679
- usedExports: (object, module1)=>{
9680
- "string" == typeof module1.usedExports ? "null" === module1.usedExports ? object.usedExports = null : object.usedExports = "true" === module1.usedExports : Array.isArray(module1.usedExports) ? object.usedExports = module1.usedExports : object.usedExports = null;
9730
+ usedExports: (object, { usedExports })=>{
9731
+ "string" == typeof usedExports ? "null" === usedExports ? object.usedExports = null : object.usedExports = "true" === usedExports : Array.isArray(usedExports) ? object.usedExports = usedExports : object.usedExports = null;
9681
9732
  },
9682
- providedExports: (object, module1)=>{
9683
- let { commonAttributes } = module1;
9684
- Array.isArray(commonAttributes.providedExports) ? object.providedExports = commonAttributes.providedExports : object.providedExports = null;
9733
+ providedExports: (object, { commonAttributes })=>{
9734
+ object.providedExports = Array.isArray(commonAttributes.providedExports) ? commonAttributes.providedExports : null;
9685
9735
  },
9686
9736
  optimizationBailout: (object, module1)=>{
9687
9737
  object.optimizationBailout = module1.commonAttributes.optimizationBailout || null;
@@ -9782,7 +9832,7 @@ Help:
9782
9832
  if (0 === reason.moduleChunks) return !1;
9783
9833
  }
9784
9834
  }
9785
- }, FILTER_RESULTS = {};
9835
+ };
9786
9836
  class DefaultStatsFactoryPlugin {
9787
9837
  apply(compiler) {
9788
9838
  compiler.hooks.compilation.tap("DefaultStatsFactoryPlugin", (compilation)=>{
@@ -9791,8 +9841,6 @@ Help:
9791
9841
  stats.hooks.extract.for(hookFor).tap("DefaultStatsFactoryPlugin", (obj, data, ctx)=>fn(obj, data, ctx, options, stats));
9792
9842
  }), iterateConfig(FILTER, options, (hookFor, fn)=>{
9793
9843
  stats.hooks.filter.for(hookFor).tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i)=>fn(item, ctx, options, idx, i));
9794
- }), iterateConfig(FILTER_RESULTS, options, (hookFor, fn)=>{
9795
- stats.hooks.filterResults.for(hookFor).tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i)=>fn(item, ctx, options, idx, i));
9796
9844
  }), iterateConfig(SORTERS, options, (hookFor, fn)=>{
9797
9845
  stats.hooks.sort.for(hookFor).tap("DefaultStatsFactoryPlugin", (comparators, ctx)=>fn(comparators, ctx, options));
9798
9846
  }), iterateConfig(RESULT_SORTERS, options, (hookFor, fn)=>{
@@ -10264,16 +10312,9 @@ Help:
10264
10312
  "loggingGroup.filteredEntries": (filteredEntries)=>filteredEntries > 0 ? `+ ${filteredEntries} hidden lines` : void 0,
10265
10313
  "moduleTraceDependency.loc": (loc)=>loc
10266
10314
  }, DefaultStatsPrinterPlugin_ITEM_NAMES = {
10267
- "compilation.assets[]": "asset",
10268
- "compilation.modules[]": "module",
10269
- "compilation.chunks[]": "chunk",
10270
- "compilation.entrypoints[]": "chunkGroup",
10271
- "compilation.namedChunkGroups[]": "chunkGroup",
10272
- "compilation.errors[]": "error",
10315
+ ...SHARED_ITEM_NAMES,
10273
10316
  "compilation.warnings[]": "error",
10274
10317
  "compilation.logging[]": "loggingGroup",
10275
- "compilation.children[]": "compilation",
10276
- "asset.related[]": "asset",
10277
10318
  "asset.children[]": "asset",
10278
10319
  "asset.chunks[]": "assetChunk",
10279
10320
  "asset.auxiliaryChunks[]": "assetChunk",
@@ -10287,13 +10328,7 @@ Help:
10287
10328
  "chunkGroupChild.auxiliaryAssets[]": "chunkGroupAsset",
10288
10329
  "chunkGroup.children[]": "chunkGroupChildGroup",
10289
10330
  "chunkGroupChildGroup.children[]": "chunkGroupChild",
10290
- "module.modules[]": "module",
10291
- "module.children[]": "module",
10292
- "module.reasons[]": "moduleReason",
10293
10331
  "moduleReason.children[]": "moduleReason",
10294
- "module.issuerPath[]": "moduleIssuer",
10295
- "chunk.origins[]": "chunkOrigin",
10296
- "chunk.modules[]": "module",
10297
10332
  "loggingGroup.entries[]": (logEntry)=>`loggingEntry(${logEntry.type}).loggingEntry`,
10298
10333
  "loggingEntry.children[]": (logEntry)=>`loggingEntry(${logEntry.type}).loggingEntry`,
10299
10334
  "error.moduleTrace[]": "moduleTraceItem",
@@ -10737,10 +10772,6 @@ Help:
10737
10772
  regExp: /(Did you mean .+)/g,
10738
10773
  format: green
10739
10774
  },
10740
- {
10741
- regExp: /(Set 'mode' option to 'development' or 'production')/g,
10742
- format: green
10743
- },
10744
10775
  {
10745
10776
  regExp: /(\(module has no exports\))/g,
10746
10777
  format: red
@@ -10753,10 +10784,6 @@ Help:
10753
10784
  regExp: /(?:^|\n)(.* doesn't exist)/g,
10754
10785
  format: red
10755
10786
  },
10756
- {
10757
- regExp: /('\w+' option has not been set)/g,
10758
- format: red
10759
- },
10760
10787
  {
10761
10788
  regExp: /(Emitted value instead of an instance of Error)/g,
10762
10789
  format: yellow
@@ -10828,7 +10855,12 @@ Help:
10828
10855
  }
10829
10856
  class RspackOptionsApply {
10830
10857
  process(options, compiler) {
10831
- if (external_node_assert_default()(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`"), compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = external_node_fs_default(), options.externals && (external_node_assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`"), new ExternalsPlugin(options.externalsType, options.externals, !1).apply(compiler)), options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui", !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
10858
+ if (!options.output.path) throw Error("options.output.path should have a value after `applyRspackOptionsDefaults`");
10859
+ if (compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = external_node_fs_default(), options.externals) {
10860
+ if (!options.externalsType) throw Error("options.externalsType should have a value after `applyRspackOptionsDefaults`");
10861
+ new ExternalsPlugin(options.externalsType, options.externals, !1).apply(compiler);
10862
+ }
10863
+ if (options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui", !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
10832
10864
  case "array-push":
10833
10865
  new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
10834
10866
  break;
@@ -11626,13 +11658,13 @@ Help:
11626
11658
  let _options = JSON.stringify(options || {});
11627
11659
  return binding_default().transform(source, _options);
11628
11660
  }
11629
- let exports_rspackVersion = "1.6.0-canary-beafb11e-20251019174144", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11661
+ let exports_rspackVersion = "1.6.0-canary-0eb13821-20251021173640", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11630
11662
  getNormalizedRspackOptions: getNormalizedRspackOptions,
11631
11663
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
11632
11664
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
11633
11665
  applyWebpackOptionsDefaults: applyRspackOptionsDefaults
11634
11666
  }, util = {
11635
- createHash: createHash,
11667
+ createHash: createHash_createHash,
11636
11668
  cleverMerge: cachedCleverMerge
11637
11669
  }, web = {
11638
11670
  FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin
@@ -11904,7 +11936,7 @@ Help:
11904
11936
  function createCompiler(userOptions) {
11905
11937
  var options;
11906
11938
  let options1 = getNormalizedRspackOptions(userOptions);
11907
- F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), external_node_assert_default()(!isNil(options1.context));
11939
+ if (F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), isNil(options1.context)) throw Error("options.context is required");
11908
11940
  let compiler = new Compiler(options1.context, options1);
11909
11941
  if (new NodeEnvironmentPlugin({
11910
11942
  infrastructureLogging: options1.infrastructureLogging
@@ -1,5 +1,11 @@
1
1
  import WebpackError from "../lib/WebpackError";
2
- export default class ModuleError extends WebpackError {
2
+ export declare class ModuleError extends WebpackError {
3
+ error?: Error;
4
+ constructor(err: Error, { from }?: {
5
+ from?: string;
6
+ });
7
+ }
8
+ export declare class ModuleWarning extends WebpackError {
3
9
  error?: Error;
4
10
  constructor(err: Error, { from }?: {
5
11
  from?: string;
@@ -1,4 +1,20 @@
1
1
  import type { Compiler } from "../Compiler";
2
+ export declare const SHARED_ITEM_NAMES: {
3
+ "compilation.children[]": string;
4
+ "compilation.modules[]": string;
5
+ "compilation.entrypoints[]": string;
6
+ "compilation.namedChunkGroups[]": string;
7
+ "compilation.errors[]": string;
8
+ "chunk.modules[]": string;
9
+ "chunk.origins[]": string;
10
+ "compilation.chunks[]": string;
11
+ "compilation.assets[]": string;
12
+ "asset.related[]": string;
13
+ "module.issuerPath[]": string;
14
+ "module.reasons[]": string;
15
+ "module.modules[]": string;
16
+ "module.children[]": string;
17
+ };
2
18
  export declare class DefaultStatsFactoryPlugin {
3
19
  apply(compiler: Compiler): void;
4
20
  }
package/dist/worker.js CHANGED
@@ -206,10 +206,9 @@ var __webpack_modules__ = {
206
206
  "./src/util/createHash.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
207
207
  let createMd4, createXxhash64;
208
208
  __webpack_require__.d(__webpack_exports__, {
209
- n: ()=>createHash
209
+ n: ()=>createHash_createHash
210
210
  });
211
- let external_node_crypto_namespaceObject = require("node:crypto");
212
- var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject), external_node_util_ = __webpack_require__("node:util");
211
+ var external_node_util_ = __webpack_require__("node:util");
213
212
  class WebpackError_WebpackError extends Error {
214
213
  loc;
215
214
  file;
@@ -383,7 +382,7 @@ var __webpack_modules__ = {
383
382
  return encoding ? this.wasmHash.digest(encoding) : this.wasmHash.digest();
384
383
  }
385
384
  }
386
- let createHash = (algorithm)=>{
385
+ let createHash_createHash = (algorithm)=>{
387
386
  if ("function" == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
388
387
  switch(algorithm){
389
388
  case "debug":
@@ -405,15 +404,24 @@ var __webpack_modules__ = {
405
404
  return createMd4();
406
405
  })());
407
406
  case "native-md4":
408
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
407
+ return new BulkUpdateDecorator(()=>{
408
+ let { createHash } = __webpack_require__("node:crypto");
409
+ return createHash("md4");
410
+ }, "md4");
409
411
  default:
410
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash(algorithm), algorithm);
412
+ return new BulkUpdateDecorator(()=>{
413
+ let { createHash } = __webpack_require__("node:crypto");
414
+ return createHash(algorithm);
415
+ }, algorithm);
411
416
  }
412
417
  };
413
418
  },
414
419
  "@rspack/binding": function(module) {
415
420
  module.exports = require("@rspack/binding");
416
421
  },
422
+ "node:crypto": function(module) {
423
+ module.exports = require("node:crypto");
424
+ },
417
425
  "node:fs": function(module) {
418
426
  module.exports = require("node:fs");
419
427
  },
@@ -430,6 +438,11 @@ var __webpack_modules__ = {
430
438
  module.exports = import("../compiled/tinypool/dist/index.js").then(function(module) {
431
439
  return module;
432
440
  });
441
+ },
442
+ "node:worker_threads": function(module) {
443
+ module.exports = import("node:worker_threads").then(function(module) {
444
+ return module;
445
+ });
433
446
  }
434
447
  }, __webpack_module_cache__ = {};
435
448
  function __webpack_require__(moduleId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.6.0-canary-beafb11e-20251019174144",
3
+ "version": "1.6.0-canary-0eb13821-20251021173640",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "@module-federation/runtime-tools": "0.20.0",
59
59
  "@rspack/lite-tapable": "1.0.1",
60
- "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-beafb11e-20251019174144"
60
+ "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-0eb13821-20251021173640"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@swc/helpers": ">=0.5.1"
@@ -1,7 +0,0 @@
1
- import WebpackError from "../lib/WebpackError";
2
- export default class ModuleWarning extends WebpackError {
3
- error?: Error;
4
- constructor(err: Error, { from }?: {
5
- from?: string;
6
- });
7
- }