@rspack-canary/core 1.6.0-canary-e3199f44-20251020173943 → 1.6.0-canary-6cd722f4-20251022123039

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.
@@ -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;
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,
@@ -4600,7 +4623,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4600
4623
  ...passThrough
4601
4624
  };
4602
4625
  }(this.options, compiler);
4603
- 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);
4604
4628
  }
4605
4629
  }
4606
4630
  let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
@@ -4652,7 +4676,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4652
4676
  for (let tag of headTags.concat(bodyTags))this.processTag(tag, publicPath, outputPath, crossOriginLoading);
4653
4677
  }
4654
4678
  processTag(tag, publicPath, outputPath, crossOriginLoading) {
4655
- var hashFuncNames, source;
4656
4679
  if (tag.attributes && "integrity" in tag.attributes) return;
4657
4680
  let tagSrc = function(tag) {
4658
4681
  if (tag.attributes) {
@@ -4666,7 +4689,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4666
4689
  }(tag);
4667
4690
  if (!tagSrc) return;
4668
4691
  let src = (0, external_node_path_namespaceObject.relative)(publicPath, decodeURIComponent(tagSrc));
4669
- 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";
4670
4696
  }
4671
4697
  apply(compiler) {
4672
4698
  if (this.isEnabled(compiler) && (super.apply(compiler), compiler.hooks.compilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
@@ -5621,7 +5647,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5621
5647
  let targets, context;
5622
5648
  F(options, "context", ()=>process.cwd()), F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
5623
5649
  let { mode, target } = options;
5624
- external_node_assert_default()(!isNil(target));
5650
+ if (isNil(target)) throw Error("target should not be nil after defaults");
5625
5651
  let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
5626
5652
  let keys = new Set();
5627
5653
  for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
@@ -5692,7 +5718,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5692
5718
  }, applyExperimentsDefaults = (experiments, { development })=>{
5693
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);
5694
5720
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5695
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-e3199f44-20251020173943"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5721
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-6cd722f4-20251022123039"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5696
5722
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5697
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 })=>{
5698
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", [
@@ -6595,7 +6621,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6595
6621
  let count = files.length;
6596
6622
  if (0 === count) fs.rmdir(p, callback);
6597
6623
  else for (let file of files){
6598
- external_node_assert_default()("string" == typeof file);
6624
+ if ("string" != typeof file) throw Error("file should be a string");
6599
6625
  let fullPath = join(fs, p, file);
6600
6626
  rmrf(fs, fullPath, (err)=>{
6601
6627
  if (err) return callback(err);
@@ -6748,7 +6774,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6748
6774
  }
6749
6775
  toString() {
6750
6776
  if (void 0 === this._hash) {
6751
- let hash = createHash(this._hashFunction);
6777
+ let hash = createHash_createHash(this._hashFunction);
6752
6778
  this._obj.updateHash(hash), this._hash = hash.digest("base64");
6753
6779
  }
6754
6780
  return this._hash;
@@ -7338,7 +7364,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7338
7364
  });
7339
7365
  }
7340
7366
  }
7341
- let CORE_VERSION = "1.6.0-canary-e3199f44-20251020173943", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7367
+ let CORE_VERSION = "1.6.0-canary-6cd722f4-20251022123039", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7342
7368
 
7343
7369
  Help:
7344
7370
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -7561,7 +7587,8 @@ Help:
7561
7587
  for (let cb of (this.compiler.hooks.failed.call(err), this.handler(err, stats), cbs || this.callbacks.splice(0)))cb(err);
7562
7588
  };
7563
7589
  if (error) return handleError(error);
7564
- 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();
7565
7592
  let startTime = this.startTime;
7566
7593
  this.startTime = void 0, compilation.startTime = startTime, compilation.endTime = Date.now();
7567
7594
  let cbs = this.callbacks;
@@ -7916,11 +7943,11 @@ Help:
7916
7943
  return this.#compilationParams = params, params;
7917
7944
  }
7918
7945
  #getInstance(callback) {
7919
- var options, compiler, output, module1, options1, parser, generator, stats;
7946
+ var options, compiler, output, stats;
7920
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));
7921
7948
  if (error) return callback(error);
7922
7949
  if (this.#instance) return callback(null, this.#instance);
7923
- 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, {
7924
7951
  name: options.name,
7925
7952
  mode,
7926
7953
  context: options.context,
@@ -7946,30 +7973,34 @@ Help:
7946
7973
  },
7947
7974
  resolve: getRawResolve(options.resolve),
7948
7975
  resolveLoader: getRawResolve(options.resolveLoader),
7949
- 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, {
7950
8000
  compiler,
7951
8001
  mode,
7952
8002
  context: options.context,
7953
8003
  experiments
7954
- }, external_node_assert_default()(!isNil(module1.defaultRules), "module.defaultRules should not be nil after defaults"), {
7955
- rules: [
7956
- {
7957
- rules: module1.defaultRules
7958
- },
7959
- {
7960
- rules: module1.rules
7961
- }
7962
- ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
7963
- parser: Object.fromEntries(Object.entries(parser = module1.parser).map(([k, v])=>[
7964
- k,
7965
- getRawParserOptions(v, k)
7966
- ]).filter(([k, v])=>void 0 !== v)),
7967
- generator: Object.fromEntries(Object.entries(generator = module1.generator).map(([k, v])=>[
7968
- k,
7969
- getRawGeneratorOptions(v, k)
7970
- ]).filter(([k, v])=>void 0 !== v)),
7971
- noParse: module1.noParse,
7972
- unsafeCache: module1.unsafeCache
7973
8004
  }),
7974
8005
  optimization: options.optimization,
7975
8006
  stats: {
@@ -7988,11 +8019,14 @@ Help:
7988
8019
  },
7989
8020
  experiments,
7990
8021
  node: function(node) {
7991
- if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
7992
- dirname: String(node.__dirname),
7993
- filename: String(node.__filename),
7994
- global: String(node.global)
7995
- };
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
+ }
7996
8030
  }(options.node),
7997
8031
  profile: options.profile,
7998
8032
  amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
@@ -8002,7 +8036,7 @@ Help:
8002
8036
  rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
8003
8037
  let instanceBinding = __webpack_require__("@rspack/binding");
8004
8038
  this.#registers = this.#createHooksRegisters();
8005
- 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;
8006
8040
  try {
8007
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);
8008
8042
  } catch (err) {
@@ -8226,7 +8260,7 @@ Help:
8226
8260
  return function(chunk) {
8227
8261
  let digestResult;
8228
8262
  if (!getCompiler2().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
8229
- let hash = createHash(getCompiler2().options.output.hashFunction);
8263
+ let hash = createHash_createHash(getCompiler2().options.output.hashFunction);
8230
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;
8231
8265
  };
8232
8266
  }),
@@ -8348,7 +8382,7 @@ Help:
8348
8382
  return function(chunk) {
8349
8383
  let digestResult;
8350
8384
  if (!getCompiler5().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
8351
- let hash = createHash(getCompiler5().options.output.hashFunction);
8385
+ let hash = createHash_createHash(getCompiler5().options.output.hashFunction);
8352
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;
8353
8387
  };
8354
8388
  })
@@ -8621,7 +8655,7 @@ Help:
8621
8655
  obj.children = this.stats.map((stat, idx)=>{
8622
8656
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8623
8657
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8624
- }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-e3199f44-20251020173943", 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-6cd722f4-20251022123039", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8625
8659
  let mapError = (j, obj)=>({
8626
8660
  ...obj,
8627
8661
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9121,15 +9155,13 @@ Help:
9121
9155
  errors: result,
9122
9156
  filtered
9123
9157
  };
9124
- }, 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 = {
9125
9159
  "compilation.children[]": "compilation",
9126
9160
  "compilation.modules[]": "module",
9127
9161
  "compilation.entrypoints[]": "chunkGroup",
9128
9162
  "compilation.namedChunkGroups[]": "chunkGroup",
9129
9163
  "compilation.errors[]": "error",
9130
- "compilation.warnings[]": "warning",
9131
9164
  "chunk.modules[]": "module",
9132
- "chunk.rootModules[]": "module",
9133
9165
  "chunk.origins[]": "chunkOrigin",
9134
9166
  "compilation.chunks[]": "chunk",
9135
9167
  "compilation.assets[]": "asset",
@@ -9137,7 +9169,11 @@ Help:
9137
9169
  "module.issuerPath[]": "moduleIssuer",
9138
9170
  "module.reasons[]": "moduleReason",
9139
9171
  "module.modules[]": "module",
9140
- "module.children[]": "module",
9172
+ "module.children[]": "module"
9173
+ }, ITEM_NAMES = {
9174
+ ...SHARED_ITEM_NAMES,
9175
+ "compilation.warnings[]": "warning",
9176
+ "chunk.rootModules[]": "module",
9141
9177
  "moduleTrace[]": "moduleTraceItem"
9142
9178
  }, MERGER = {
9143
9179
  "compilation.entrypoints": mergeToObject,
@@ -9500,7 +9536,7 @@ Help:
9500
9536
  }
9501
9537
  let newEntry = {
9502
9538
  type,
9503
- 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)) : "",
9504
9540
  trace: loggingTrace ? entry.trace : void 0,
9505
9541
  children: type === LogType.group || type === LogType.groupCollapsed ? [] : void 0
9506
9542
  };
@@ -9518,7 +9554,7 @@ Help:
9518
9554
  object.hash = context.getStatsCompilation(compilation).hash;
9519
9555
  },
9520
9556
  version: (object)=>{
9521
- object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-e3199f44-20251020173943";
9557
+ object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-6cd722f4-20251022123039";
9522
9558
  },
9523
9559
  env: (object, _compilation, _context, { _env })=>{
9524
9560
  object.env = _env;
@@ -9555,8 +9591,13 @@ Help:
9555
9591
  depItem && (assets.delete(depItem), depItem.type = type, item.related = item.related || [], item.related.push(depItem));
9556
9592
  }
9557
9593
  }
9558
- object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
9559
- 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
+ ], {
9560
9601
  ...context
9561
9602
  }), options.assetsSpace ?? 1 / 0);
9562
9603
  object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
@@ -9686,12 +9727,11 @@ Help:
9686
9727
  let { commonAttributes } = module1;
9687
9728
  object.source = commonAttributes.source;
9688
9729
  },
9689
- usedExports: (object, module1)=>{
9690
- "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;
9691
9732
  },
9692
- providedExports: (object, module1)=>{
9693
- let { commonAttributes } = module1;
9694
- 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;
9695
9735
  },
9696
9736
  optimizationBailout: (object, module1)=>{
9697
9737
  object.optimizationBailout = module1.commonAttributes.optimizationBailout || null;
@@ -9792,7 +9832,7 @@ Help:
9792
9832
  if (0 === reason.moduleChunks) return !1;
9793
9833
  }
9794
9834
  }
9795
- }, FILTER_RESULTS = {};
9835
+ };
9796
9836
  class DefaultStatsFactoryPlugin {
9797
9837
  apply(compiler) {
9798
9838
  compiler.hooks.compilation.tap("DefaultStatsFactoryPlugin", (compilation)=>{
@@ -9801,8 +9841,6 @@ Help:
9801
9841
  stats.hooks.extract.for(hookFor).tap("DefaultStatsFactoryPlugin", (obj, data, ctx)=>fn(obj, data, ctx, options, stats));
9802
9842
  }), iterateConfig(FILTER, options, (hookFor, fn)=>{
9803
9843
  stats.hooks.filter.for(hookFor).tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i)=>fn(item, ctx, options, idx, i));
9804
- }), iterateConfig(FILTER_RESULTS, options, (hookFor, fn)=>{
9805
- stats.hooks.filterResults.for(hookFor).tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i)=>fn(item, ctx, options, idx, i));
9806
9844
  }), iterateConfig(SORTERS, options, (hookFor, fn)=>{
9807
9845
  stats.hooks.sort.for(hookFor).tap("DefaultStatsFactoryPlugin", (comparators, ctx)=>fn(comparators, ctx, options));
9808
9846
  }), iterateConfig(RESULT_SORTERS, options, (hookFor, fn)=>{
@@ -10274,16 +10312,9 @@ Help:
10274
10312
  "loggingGroup.filteredEntries": (filteredEntries)=>filteredEntries > 0 ? `+ ${filteredEntries} hidden lines` : void 0,
10275
10313
  "moduleTraceDependency.loc": (loc)=>loc
10276
10314
  }, DefaultStatsPrinterPlugin_ITEM_NAMES = {
10277
- "compilation.assets[]": "asset",
10278
- "compilation.modules[]": "module",
10279
- "compilation.chunks[]": "chunk",
10280
- "compilation.entrypoints[]": "chunkGroup",
10281
- "compilation.namedChunkGroups[]": "chunkGroup",
10282
- "compilation.errors[]": "error",
10315
+ ...SHARED_ITEM_NAMES,
10283
10316
  "compilation.warnings[]": "error",
10284
10317
  "compilation.logging[]": "loggingGroup",
10285
- "compilation.children[]": "compilation",
10286
- "asset.related[]": "asset",
10287
10318
  "asset.children[]": "asset",
10288
10319
  "asset.chunks[]": "assetChunk",
10289
10320
  "asset.auxiliaryChunks[]": "assetChunk",
@@ -10297,13 +10328,7 @@ Help:
10297
10328
  "chunkGroupChild.auxiliaryAssets[]": "chunkGroupAsset",
10298
10329
  "chunkGroup.children[]": "chunkGroupChildGroup",
10299
10330
  "chunkGroupChildGroup.children[]": "chunkGroupChild",
10300
- "module.modules[]": "module",
10301
- "module.children[]": "module",
10302
- "module.reasons[]": "moduleReason",
10303
10331
  "moduleReason.children[]": "moduleReason",
10304
- "module.issuerPath[]": "moduleIssuer",
10305
- "chunk.origins[]": "chunkOrigin",
10306
- "chunk.modules[]": "module",
10307
10332
  "loggingGroup.entries[]": (logEntry)=>`loggingEntry(${logEntry.type}).loggingEntry`,
10308
10333
  "loggingEntry.children[]": (logEntry)=>`loggingEntry(${logEntry.type}).loggingEntry`,
10309
10334
  "error.moduleTrace[]": "moduleTraceItem",
@@ -10747,10 +10772,6 @@ Help:
10747
10772
  regExp: /(Did you mean .+)/g,
10748
10773
  format: green
10749
10774
  },
10750
- {
10751
- regExp: /(Set 'mode' option to 'development' or 'production')/g,
10752
- format: green
10753
- },
10754
10775
  {
10755
10776
  regExp: /(\(module has no exports\))/g,
10756
10777
  format: red
@@ -10763,10 +10784,6 @@ Help:
10763
10784
  regExp: /(?:^|\n)(.* doesn't exist)/g,
10764
10785
  format: red
10765
10786
  },
10766
- {
10767
- regExp: /('\w+' option has not been set)/g,
10768
- format: red
10769
- },
10770
10787
  {
10771
10788
  regExp: /(Emitted value instead of an instance of Error)/g,
10772
10789
  format: yellow
@@ -10838,7 +10855,12 @@ Help:
10838
10855
  }
10839
10856
  class RspackOptionsApply {
10840
10857
  process(options, compiler) {
10841
- 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){
10842
10864
  case "array-push":
10843
10865
  new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
10844
10866
  break;
@@ -11636,13 +11658,13 @@ Help:
11636
11658
  let _options = JSON.stringify(options || {});
11637
11659
  return binding_default().transform(source, _options);
11638
11660
  }
11639
- let exports_rspackVersion = "1.6.0-canary-e3199f44-20251020173943", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11661
+ let exports_rspackVersion = "1.6.0-canary-6cd722f4-20251022123039", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11640
11662
  getNormalizedRspackOptions: getNormalizedRspackOptions,
11641
11663
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
11642
11664
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
11643
11665
  applyWebpackOptionsDefaults: applyRspackOptionsDefaults
11644
11666
  }, util = {
11645
- createHash: createHash,
11667
+ createHash: createHash_createHash,
11646
11668
  cleverMerge: cachedCleverMerge
11647
11669
  }, web = {
11648
11670
  FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin
@@ -11914,7 +11936,7 @@ Help:
11914
11936
  function createCompiler(userOptions) {
11915
11937
  var options;
11916
11938
  let options1 = getNormalizedRspackOptions(userOptions);
11917
- 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");
11918
11940
  let compiler = new Compiler(options1.context, options1);
11919
11941
  if (new NodeEnvironmentPlugin({
11920
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-e3199f44-20251020173943",
3
+ "version": "1.6.0-canary-6cd722f4-20251022123039",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -41,7 +41,7 @@
41
41
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
42
42
  "@rslib/core": "0.15.1",
43
43
  "@swc/types": "0.1.25",
44
- "@types/node": "^20.19.21",
44
+ "@types/node": "^20.19.23",
45
45
  "@types/watchpack": "^2.4.4",
46
46
  "browserslist-load-config": "^1.0.1",
47
47
  "enhanced-resolve": "5.18.3",
@@ -55,9 +55,9 @@
55
55
  "webpack-sources": "3.3.3"
56
56
  },
57
57
  "dependencies": {
58
- "@module-federation/runtime-tools": "0.20.0",
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-e3199f44-20251020173943"
60
+ "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-6cd722f4-20251022123039"
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
- }