@rspack/core 1.4.11 → 1.5.0-beta.1

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.
Files changed (88) hide show
  1. package/dist/Compilation.d.ts +2 -2
  2. package/dist/Compiler.d.ts +5 -0
  3. package/dist/Module.d.ts +3 -14
  4. package/dist/NativeWatchFileSystem.d.ts +3 -1
  5. package/dist/NormalModuleFactory.d.ts +2 -2
  6. package/dist/Resolver.d.ts +0 -6
  7. package/dist/ResolverFactory.d.ts +8 -5
  8. package/dist/VirtualModulesPlugin.d.ts +12 -0
  9. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  10. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  11. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  12. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  13. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
  52. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/base.d.ts +2 -2
  70. package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
  71. package/dist/builtin-plugin/index.d.ts +1 -0
  72. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  73. package/dist/config/normalization.d.ts +7 -0
  74. package/dist/config/types.d.ts +20 -4
  75. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  76. package/dist/exports.d.ts +11 -3
  77. package/dist/index.js +298 -256
  78. package/dist/loader-runner/loadLoader.d.ts +2 -1
  79. package/dist/loader-runner/utils.d.ts +2 -1
  80. package/dist/schema/config.d.ts +60 -47
  81. package/dist/schema/loaders.d.ts +5 -5
  82. package/dist/schema/plugins.d.ts +10 -10
  83. package/dist/util/bindingVersionCheck.d.ts +1 -1
  84. package/dist/util/require.d.ts +3 -0
  85. package/dist/worker.js +93 -59
  86. package/module.d.ts +9 -10
  87. package/package.json +11 -9
  88. package/dist/lib/NormalModuleReplacementPlugin.d.ts +0 -29
package/dist/index.js CHANGED
@@ -351,7 +351,7 @@ for(var __webpack_i__ in (()=>{
351
351
  wasm: ()=>exports_wasm,
352
352
  version: ()=>exports_version
353
353
  });
354
- var RequestType, StatsErrorCode, _computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
354
+ var StatsErrorCode, _computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
355
355
  __webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
356
356
  resolve: ()=>browserslistTargetHandler_resolve
357
357
  });
@@ -2907,7 +2907,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2907
2907
  concurrentTasksPerWorker: 1
2908
2908
  });
2909
2909
  }));
2910
- var service_RequestType = ((RequestType = {}).AddDependency = "AddDependency", RequestType.AddContextDependency = "AddContextDependency", RequestType.AddMissingDependency = "AddMissingDependency", RequestType.AddBuildDependency = "AddBuildDependency", RequestType.GetDependencies = "GetDependencies", RequestType.GetContextDependencies = "GetContextDependencies", RequestType.GetMissingDependencies = "GetMissingDependencies", RequestType.ClearDependencies = "ClearDependencies", RequestType.Resolve = "Resolve", RequestType.GetResolve = "GetResolve", RequestType.GetLogger = "GetLogger", RequestType.EmitError = "EmitError", RequestType.EmitWarning = "EmitWarning", RequestType.EmitFile = "EmitFile", RequestType.EmitDiagnostic = "EmitDiagnostic", RequestType.SetCacheable = "SetCacheable", RequestType.ImportModule = "ImportModule", RequestType.UpdateLoaderObjects = "UpdateLoaderObjects", RequestType.CompilationGetPath = "CompilationGetPath", RequestType.CompilationGetPathWithInfo = "CompilationGetPathWithInfo", RequestType.CompilationGetAssetPath = "CompilationGetAssetPath", RequestType.CompilationGetAssetPathWithInfo = "CompilationGetAssetPathWithInfo", RequestType);
2911
2910
  function serializeError(error) {
2912
2911
  if (error instanceof Error || error && "object" == typeof error && "message" in error) return {
2913
2912
  ...error,
@@ -2996,12 +2995,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2996
2995
  ]
2997
2996
  }).catch(handleError);
2998
2997
  });
2999
- }), LoaderLoadingError = class extends Error {
2998
+ }), external_node_fs_namespaceObject = require("node:fs");
2999
+ var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
3000
+ let LoaderLoadingError = class extends Error {
3000
3001
  constructor(message){
3001
3002
  super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
3002
3003
  }
3003
3004
  };
3004
- function loadLoader(loader, callback) {
3005
+ function loadLoader(loader, compiler, callback) {
3005
3006
  if ("module" === loader.type) try {
3006
3007
  void 0 === loadLoader_url && (loadLoader_url = __webpack_require__("node:url")), import(loadLoader_url.pathToFileURL(loader.path).toString()).then((module)=>{
3007
3008
  handleResult(loader, module, callback);
@@ -3015,7 +3016,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3015
3016
  try {
3016
3017
  module = require(loader.path);
3017
3018
  } catch (e) {
3018
- if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, callback));
3019
+ if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
3019
3020
  return callback(e);
3020
3021
  }
3021
3022
  return handleResult(loader, module, callback);
@@ -3385,7 +3386,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3385
3386
  resource: loaderContext.resource,
3386
3387
  mode: loaderContext.mode,
3387
3388
  sourceMap: loaderContext.sourceMap,
3388
- rootContext: loaderContext.context,
3389
+ rootContext: loaderContext.rootContext,
3389
3390
  loaderIndex: loaderContext.loaderIndex,
3390
3391
  loaders: loaderContext.loaders.map((item)=>{
3391
3392
  let options = item.options;
@@ -3437,77 +3438,77 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3437
3438
  }, {
3438
3439
  handleIncomingRequest (requestType, ...args) {
3439
3440
  switch(requestType){
3440
- case service_RequestType.AddDependency:
3441
+ case "AddDependency":
3441
3442
  loaderContext.addDependency(args[0]);
3442
3443
  break;
3443
- case service_RequestType.AddContextDependency:
3444
+ case "AddContextDependency":
3444
3445
  loaderContext.addContextDependency(args[0]);
3445
3446
  break;
3446
- case service_RequestType.AddMissingDependency:
3447
+ case "AddMissingDependency":
3447
3448
  loaderContext.addMissingDependency(args[0]);
3448
3449
  break;
3449
- case service_RequestType.AddBuildDependency:
3450
+ case "AddBuildDependency":
3450
3451
  loaderContext.addBuildDependency(args[0]);
3451
3452
  break;
3452
- case service_RequestType.GetDependencies:
3453
+ case "GetDependencies":
3453
3454
  return loaderContext.getDependencies();
3454
- case service_RequestType.GetContextDependencies:
3455
+ case "GetContextDependencies":
3455
3456
  return loaderContext.getContextDependencies();
3456
- case service_RequestType.GetMissingDependencies:
3457
+ case "GetMissingDependencies":
3457
3458
  return loaderContext.getMissingDependencies();
3458
- case service_RequestType.ClearDependencies:
3459
+ case "ClearDependencies":
3459
3460
  loaderContext.clearDependencies();
3460
3461
  break;
3461
- case service_RequestType.Resolve:
3462
+ case "Resolve":
3462
3463
  return new Promise((resolve, reject)=>{
3463
3464
  loaderContext.resolve(args[0], args[1], (err, result)=>{
3464
3465
  err ? reject(err) : resolve(result);
3465
3466
  });
3466
3467
  });
3467
- case service_RequestType.GetResolve:
3468
+ case "GetResolve":
3468
3469
  return new Promise((resolve, reject)=>{
3469
3470
  loaderContext.getResolve(args[0])(args[1], args[2], (err, result)=>{
3470
3471
  err ? reject(err) : resolve(result);
3471
3472
  });
3472
3473
  });
3473
- case service_RequestType.GetLogger:
3474
+ case "GetLogger":
3474
3475
  {
3475
3476
  let [type, name, arg] = args;
3476
3477
  loaderContext.getLogger(name)[type](...arg);
3477
3478
  }
3478
- case service_RequestType.EmitError:
3479
+ case "EmitError":
3479
3480
  {
3480
3481
  let workerError = args[0], error = Error(workerError.message);
3481
3482
  error.stack = workerError.stack, error.name = workerError.name, loaderContext.emitError(error);
3482
3483
  break;
3483
3484
  }
3484
- case service_RequestType.EmitWarning:
3485
+ case "EmitWarning":
3485
3486
  {
3486
3487
  let workerError = args[0], error = Error(workerError.message);
3487
3488
  error.stack = workerError.stack, error.name = workerError.name, loaderContext.emitWarning(error);
3488
3489
  break;
3489
3490
  }
3490
- case service_RequestType.EmitFile:
3491
+ case "EmitFile":
3491
3492
  {
3492
3493
  let [name, content, sourceMap, assetInfo] = args;
3493
3494
  loaderContext.emitFile(name, content, sourceMap, assetInfo);
3494
3495
  break;
3495
3496
  }
3496
- case service_RequestType.EmitDiagnostic:
3497
+ case "EmitDiagnostic":
3497
3498
  {
3498
3499
  let diagnostic = args[0];
3499
3500
  loaderContext.experiments.emitDiagnostic(diagnostic);
3500
3501
  break;
3501
3502
  }
3502
- case service_RequestType.SetCacheable:
3503
+ case "SetCacheable":
3503
3504
  {
3504
3505
  let cacheable = args[0];
3505
3506
  loaderContext.cacheable(cacheable);
3506
3507
  break;
3507
3508
  }
3508
- case service_RequestType.ImportModule:
3509
+ case "ImportModule":
3509
3510
  return loaderContext.importModule(args[0], args[1]);
3510
- case service_RequestType.UpdateLoaderObjects:
3511
+ case "UpdateLoaderObjects":
3511
3512
  {
3512
3513
  let updates = args[0];
3513
3514
  loaderContext.loaders = loaderContext.loaders.map((item, index)=>{
@@ -3516,22 +3517,22 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3516
3517
  });
3517
3518
  break;
3518
3519
  }
3519
- case service_RequestType.CompilationGetPath:
3520
+ case "CompilationGetPath":
3520
3521
  {
3521
3522
  let filename = args[0], data = args[1];
3522
3523
  return compiler._lastCompilation.getPath(filename, data);
3523
3524
  }
3524
- case service_RequestType.CompilationGetPathWithInfo:
3525
+ case "CompilationGetPathWithInfo":
3525
3526
  {
3526
3527
  let filename = args[0], data = args[1];
3527
3528
  return compiler._lastCompilation.getPathWithInfo(filename, data);
3528
3529
  }
3529
- case service_RequestType.CompilationGetAssetPath:
3530
+ case "CompilationGetAssetPath":
3530
3531
  {
3531
3532
  let filename = args[0], data = args[1];
3532
3533
  return compiler._lastCompilation.getAssetPath(filename, data);
3533
3534
  }
3534
- case service_RequestType.CompilationGetAssetPathWithInfo:
3535
+ case "CompilationGetAssetPathWithInfo":
3535
3536
  {
3536
3537
  let filename = args[0], data = args[1];
3537
3538
  return compiler._lastCompilation.getAssetPathWithInfo(filename, data);
@@ -3569,7 +3570,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3569
3570
  loaderContext.loaderIndex += 1;
3570
3571
  continue;
3571
3572
  }
3572
- await utils_loadLoader(currentLoaderObject);
3573
+ await utils_loadLoader(currentLoaderObject, compiler);
3573
3574
  let fn = currentLoaderObject.pitch;
3574
3575
  if (parallelism && fn || (currentLoaderObject.pitchExecuted = !0), !fn) continue;
3575
3576
  let args = await isomorphoicRun(fn, [
@@ -3594,7 +3595,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3594
3595
  loaderContext.loaderIndex--;
3595
3596
  continue;
3596
3597
  }
3597
- await utils_loadLoader(currentLoaderObject);
3598
+ await utils_loadLoader(currentLoaderObject, compiler);
3598
3599
  let fn = currentLoaderObject.normal;
3599
3600
  parallelism && fn || (currentLoaderObject.normalExecuted = !0), fn && ([content, sourceMap, additionalData] = await isomorphoicRun(fn, [
3600
3601
  content,
@@ -3713,7 +3714,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3713
3714
  alias: getRawAlias(resolve.alias),
3714
3715
  fallback: getRawAlias(resolve.fallback),
3715
3716
  extensionAlias: function(alias = {}) {
3716
- return Object.fromEntries(Object.entries(alias).map(([key, value])=>Array.isArray(value) ? [
3717
+ if ("object" == typeof alias && null !== alias) return Object.fromEntries(Object.entries(alias).map(([key, value])=>Array.isArray(value) ? [
3717
3718
  key,
3718
3719
  value
3719
3720
  ] : [
@@ -3898,6 +3899,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3898
3899
  importMeta: parser.importMeta,
3899
3900
  url: parser.url?.toString(),
3900
3901
  exprContextCritical: parser.exprContextCritical,
3902
+ unknownContextCritical: parser.unknownContextCritical,
3901
3903
  wrappedContextCritical: parser.wrappedContextCritical,
3902
3904
  wrappedContextRegExp: parser.wrappedContextRegExp,
3903
3905
  exportsPresence: !1 === parser.exportsPresence ? "false" : parser.exportsPresence,
@@ -4025,6 +4027,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4025
4027
  let resolveRequest = this.#resolveRequestCache.get(text);
4026
4028
  return resolveRequest || (resolveRequest = JSON.parse(text), this.#resolveRequestCache.set(text, resolveRequest)), Object.assign({}, resolveRequest);
4027
4029
  };
4030
+ #processRequest(req) {
4031
+ return `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`;
4032
+ }
4028
4033
  #getRawExternalItem = (item)=>{
4029
4034
  if ("string" == typeof item || item instanceof RegExp) return item;
4030
4035
  if ("function" == typeof item) {
@@ -4038,7 +4043,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4038
4043
  issuer: data.contextInfo.issuer,
4039
4044
  issuerLayer: data.contextInfo.issuerLayer ?? null
4040
4045
  },
4041
- getResolve (options) {
4046
+ getResolve: (options)=>{
4042
4047
  let rawResolve = options ? getRawResolve(options) : void 0, resolve = ctx.getResolve(rawResolve);
4043
4048
  return (context, request, callback)=>{
4044
4049
  if (!callback) return new Promise((promiseResolve, promiseReject)=>{
@@ -4046,7 +4051,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4046
4051
  if (error) promiseReject(error);
4047
4052
  else {
4048
4053
  let req = processResolveResult(text);
4049
- promiseResolve(req?.path);
4054
+ promiseResolve(req ? this.#processRequest(req) : void 0);
4050
4055
  }
4051
4056
  });
4052
4057
  });
@@ -4054,7 +4059,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4054
4059
  if (error) callback(error);
4055
4060
  else {
4056
4061
  let req = processResolveResult(text);
4057
- callback(null, req?.path ?? !1, req);
4062
+ callback(null, !!req && this.#processRequest(req), req);
4058
4063
  }
4059
4064
  });
4060
4065
  };
@@ -6325,7 +6330,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6325
6330
  let ZodRecord = $constructor("ZodRecord", (inst, def)=>{
6326
6331
  $ZodRecord.init(inst, def), ZodType.init(inst, def), inst.keyType = def.keyType, inst.valueType = def.valueType;
6327
6332
  });
6328
- function record(keyType, valueType, params) {
6333
+ function schemas_record(keyType, valueType, params) {
6329
6334
  return new ZodRecord({
6330
6335
  type: "record",
6331
6336
  keyType,
@@ -6553,7 +6558,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6553
6558
  buildMeta: custom(),
6554
6559
  exports: schemas_array(schemas_string()).or(literal(!0)),
6555
6560
  id: schemas_string().or(numberOrInfinity)
6556
- }).partial(), dllReferencePluginOptionsContent = record(schemas_string(), dllReferencePluginOptionsContentItem), dllReferencePluginOptionsSourceType = schemas_enum([
6561
+ }).partial(), dllReferencePluginOptionsContent = schemas_record(schemas_string(), dllReferencePluginOptionsContentItem), dllReferencePluginOptionsSourceType = schemas_enum([
6557
6562
  "var",
6558
6563
  "assign",
6559
6564
  "this",
@@ -6605,7 +6610,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6605
6610
  error: "HtmlRspackPlugin does not support template path with loader yet"
6606
6611
  }),
6607
6612
  templateContent: schemas_string().or(anyFunction),
6608
- templateParameters: record(schemas_string(), schemas_string()).or(schemas_boolean()).or(anyFunction),
6613
+ templateParameters: schemas_record(schemas_string(), schemas_string()).or(schemas_boolean()).or(anyFunction),
6609
6614
  inject: schemas_enum([
6610
6615
  "head",
6611
6616
  "body"
@@ -6640,7 +6645,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6640
6645
  minify: schemas_boolean(),
6641
6646
  title: schemas_string(),
6642
6647
  favicon: schemas_string(),
6643
- meta: record(schemas_string(), schemas_string().or(record(schemas_string(), schemas_string()))),
6648
+ meta: schemas_record(schemas_string(), schemas_string().or(schemas_record(schemas_string(), schemas_string()))),
6644
6649
  hash: schemas_boolean()
6645
6650
  }).partial());
6646
6651
  function isZodErrorLike(err) {
@@ -7088,9 +7093,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7088
7093
  return !1;
7089
7094
  }
7090
7095
  }
7091
- let compilationOptionsMap = new WeakMap(), external_node_fs_namespaceObject = require("node:fs");
7092
- var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
7093
- let hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7096
+ let compilationOptionsMap = new WeakMap(), hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7094
7097
  let templateFn, templateParameters, filenames;
7095
7098
  validate(c, getHtmlPluginOptionsSchema);
7096
7099
  let uid = HTML_PLUGIN_UID++, meta = {};
@@ -7159,7 +7162,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7159
7162
  let context = this.options.context || process.cwd(), templateFilePath = external_node_path_default().resolve(context, filename);
7160
7163
  if (!external_node_fs_default().existsSync(templateFilePath)) throw Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
7161
7164
  try {
7162
- let renderer = require(templateFilePath);
7165
+ let renderer = await async function(id) {
7166
+ return require(id);
7167
+ }(templateFilePath);
7163
7168
  if (!1 === c.templateParameters) return await renderer({});
7164
7169
  return await renderer(generateRenderData(data));
7165
7170
  } catch (e) {
@@ -7304,41 +7309,39 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7304
7309
  test
7305
7310
  }), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
7306
7311
  "function" == typeof next && next();
7307
- };
7308
- function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
7312
+ }, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence.";
7313
+ function applyPlugin(compiler, options, activeModules, filesByKey) {
7309
7314
  new BuiltinLazyCompilationPlugin(({ module, path })=>{
7310
- let compiler1, index = moduleToIndex.get(module);
7311
- void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
7312
- let key = indexToModule.get(index);
7313
- filesByKey.set(key, path);
7314
- let active = !0 === activeModules.get(key);
7315
+ let compiler1, data = `${encodeURIComponent(module.replace(/\\/g, "/").replace(/@/g, "_"))}`;
7316
+ filesByKey.set(data, path);
7317
+ let active = activeModules.has(data);
7315
7318
  return {
7316
7319
  client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
7317
7320
  let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
7318
7321
  return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
7319
7322
  })(options))}`,
7320
- data: index,
7323
+ data,
7321
7324
  active
7322
7325
  };
7323
7326
  }, options.cacheable ?? !0, options.entries ?? !0, options.imports ?? !0, options.test).apply(compiler);
7324
7327
  }
7325
- let lazyCompilationMiddlewareInternal = (compiler, indexToModule, activeModules, filesByKey, lazyCompilationPrefix)=>{
7328
+ let lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey, lazyCompilationPrefix)=>{
7326
7329
  let logger = compiler.getInfrastructureLogger("LazyCompilation");
7327
7330
  return (req, res, next)=>{
7328
7331
  if (!req.url?.startsWith(lazyCompilationPrefix)) return next?.();
7329
- let indices = req.url.slice(lazyCompilationPrefix.length).split("@");
7332
+ let modules = req.url.slice(lazyCompilationPrefix.length).split("@");
7330
7333
  req.socket.setNoDelay(!0), res.setHeader("content-type", "text/event-stream"), res.writeHead(200), res.write("\n");
7331
7334
  let moduleActivated = [];
7332
- for (let index of indices){
7333
- let key = indexToModule.get(index), oldValue = activeModules.get(key) ?? !1;
7334
- activeModules.set(key, !0), oldValue || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
7335
+ for (let key of modules){
7336
+ let activated = activeModules.has(key);
7337
+ activeModules.add(key), activated || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
7335
7338
  }
7336
7339
  if (moduleActivated.length && compiler.watching) {
7337
7340
  let rebuiltModules = new Set(moduleActivated.map((key)=>{
7338
7341
  let filePath = filesByKey.get(key);
7339
7342
  return filePath || logger.warn(`Cannot find correct file path for module ${key}`), filePath;
7340
7343
  }).filter(Boolean));
7341
- rebuiltModules.size && compiler.watching.invalidateWithChangesAndRemovals(new Set(rebuiltModules));
7344
+ rebuiltModules.size && compiler.watching.invalidateWithChangesAndRemovals(rebuiltModules);
7342
7345
  }
7343
7346
  };
7344
7347
  };
@@ -7376,7 +7379,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7376
7379
  return createBuiltinPlugin(this.name, void 0);
7377
7380
  }
7378
7381
  }
7379
- let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), OccurrenceChunkIdsPlugin = base_create(binding_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
7382
+ let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), NormalModuleReplacementPlugin = base_create(binding_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
7383
+ resourceRegExp,
7384
+ newResource: "function" == typeof newResource ? (data)=>(newResource(data), data) : newResource
7385
+ })), OccurrenceChunkIdsPlugin = base_create(binding_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
7380
7386
  ...options
7381
7387
  }), "compilation"), ProgressPlugin = base_create(binding_.BuiltinPluginName.ProgressPlugin, (progress = {})=>"function" == typeof progress ? {
7382
7388
  handler: (percentage, msg, items)=>{
@@ -7611,28 +7617,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7611
7617
  });
7612
7618
  });
7613
7619
  }), "string" == typeof this.options.htmlPlugin && this.options.htmlPlugin !== NATIVE_HTML_PLUGIN) {
7614
- let getHooks = null;
7620
+ let self = this;
7615
7621
  try {
7616
- let htmlPlugin = require(this.options.htmlPlugin);
7617
- getHooks = htmlPlugin.getCompilationHooks || htmlPlugin.getHooks;
7622
+ var obj, htmlPlugin = require(this.options.htmlPlugin);
7623
+ let getHooks = htmlPlugin.getCompilationHooks || htmlPlugin.getHooks;
7624
+ "function" == typeof getHooks && compiler.hooks.thisCompilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
7625
+ if ("string" == typeof compiler.options.output.chunkLoading && [
7626
+ "require",
7627
+ "async-node"
7628
+ ].includes(compiler.options.output.chunkLoading)) return;
7629
+ let hwpHooks = getHooks(compilation);
7630
+ hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>(self.handleHwpPluginArgs(data), data)), hwpHooks.alterAssetTagGroups.tapPromise({
7631
+ name: SubresourceIntegrityPlugin_PLUGIN_NAME,
7632
+ stage: 10000
7633
+ }, async (data)=>(self.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), data));
7634
+ });
7618
7635
  } catch (e) {
7619
- var obj;
7620
7636
  if (!((obj = e) instanceof Error && "code" in obj && [
7621
7637
  "string",
7622
7638
  "undefined"
7623
7639
  ].includes(typeof obj.code)) || "MODULE_NOT_FOUND" !== e.code) throw e;
7624
7640
  }
7625
- "function" == typeof getHooks && compiler.hooks.thisCompilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
7626
- if ("string" == typeof compiler.options.output.chunkLoading && [
7627
- "require",
7628
- "async-node"
7629
- ].includes(compiler.options.output.chunkLoading)) return;
7630
- let hwpHooks = getHooks(compilation);
7631
- hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>(this.handleHwpPluginArgs(data), data)), hwpHooks.alterAssetTagGroups.tapPromise({
7632
- name: SubresourceIntegrityPlugin_PLUGIN_NAME,
7633
- stage: 10000
7634
- }, async (data)=>(this.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), data));
7635
- });
7636
7641
  }
7637
7642
  }
7638
7643
  }
@@ -8574,7 +8579,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8574
8579
  if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
8575
8580
  "./src"
8576
8581
  ]);
8577
- defaults_F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), D(options, "bail", !1), defaults_F(options, "cache", ()=>development), applyExperimentsDefaults(options.experiments, {
8582
+ defaults_F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), D(options, "lazyCompilation", !1), D(options, "bail", !1), defaults_F(options, "cache", ()=>development), applyExperimentsDefaults(options.experiments, {
8578
8583
  production,
8579
8584
  development
8580
8585
  }), !1 === options.cache && (options.experiments.cache = !1), applySnapshotDefaults(options.snapshot, {
@@ -8584,7 +8589,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8584
8589
  css: options.experiments.css,
8585
8590
  targetProperties,
8586
8591
  mode: options.mode,
8587
- uniqueName: options.output.uniqueName
8592
+ uniqueName: options.output.uniqueName,
8593
+ inlineConst: options.experiments.inlineConst
8588
8594
  }), applyOutputDefaults(options.output, {
8589
8595
  context: options.context,
8590
8596
  targetProperties,
@@ -8616,17 +8622,20 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8616
8622
  }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
8617
8623
  }, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
8618
8624
  defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
8619
- let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
8625
+ let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
8620
8626
  D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
8621
8627
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
8622
- defaults_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, "layers", !1), 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", !0), 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);
8628
+ defaults_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, "layers", !1), !1 === experiments.topLevelAwait && console.warn("`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration."), 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", !0), 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", !1);
8623
8629
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
8624
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.11"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
8625
- }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
8626
- var parserOptions;
8627
- if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !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, "importDynamic", !0), D(parserOptions, "worker", [
8628
- "..."
8629
- ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant"), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
8630
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0-beta.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
8631
+ }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
8632
+ if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { inlineConst })=>{
8633
+ 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, "importDynamic", !0), D(parserOptions, "worker", [
8634
+ "..."
8635
+ ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", inlineConst), D(parserOptions, "typeReexportsPresence", "no-tolerant");
8636
+ })(module.parser.javascript, {
8637
+ inlineConst
8638
+ }), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
8630
8639
  defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
8631
8640
  let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
8632
8641
  D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
@@ -8810,7 +8819,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8810
8819
  }), defaults_F(output, "cssChunkFilename", ()=>{
8811
8820
  let chunkFilename = output.chunkFilename;
8812
8821
  return "function" != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1") : "[id].css";
8813
- }), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`), D(output, "hotUpdateMainFilename", "[runtime].[fullhash].hot-update.json");
8822
+ }), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`), defaults_F(output, "hotUpdateMainFilename", ()=>`[runtime].[fullhash].hot-update.${output.module ? "json.mjs" : "json"}`);
8814
8823
  let uniqueNameId = Template.toIdentifier(output.uniqueName);
8815
8824
  defaults_F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), defaults_F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), defaults_F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), defaults_F(output, "pathinfo", ()=>development), D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && defaults_F(output.library, "type", ()=>output.module ? "module" : "var"), defaults_F(output, "chunkFormat", ()=>{
8816
8825
  if (tp) {
@@ -9264,7 +9273,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9264
9273
  devServer: config.devServer,
9265
9274
  profile: config.profile,
9266
9275
  amd: config.amd,
9267
- bail: config.bail
9276
+ bail: config.bail,
9277
+ lazyCompilation: optionalNestedConfig(config.lazyCompilation, (options)=>!0 === options ? {} : options)
9268
9278
  };
9269
9279
  }, getNormalizedEntryStatic = (entry)=>{
9270
9280
  if ("string" == typeof entry) return {
@@ -9860,7 +9870,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9860
9870
  }
9861
9871
  class Resolver {
9862
9872
  #binding;
9863
- #childCache = new WeakMap();
9864
9873
  constructor(binding){
9865
9874
  this.#binding = binding;
9866
9875
  }
@@ -9874,32 +9883,42 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9874
9883
  callback(error, !!req && `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`, req);
9875
9884
  });
9876
9885
  }
9877
- withOptions(options) {
9878
- let cacheEntry = this.#childCache.get(options);
9879
- if (void 0 !== cacheEntry) return cacheEntry;
9880
- let { dependencyCategory, resolveToContext, ...resolve } = options, rawResolve = getRawResolve(resolve), resolver = new Resolver(this.#binding.withOptions({
9881
- dependencyCategory,
9882
- resolveToContext,
9883
- ...rawResolve
9884
- }));
9885
- return this.#childCache.set(options, resolver), resolver;
9886
- }
9887
9886
  }
9887
+ let EMPTY_RESOLVE_OPTIONS = {};
9888
9888
  class ResolverFactory {
9889
9889
  #binding;
9890
+ #cache = new Map();
9890
9891
  static __to_binding(resolver_factory) {
9891
9892
  return resolver_factory.#binding;
9892
9893
  }
9893
- constructor(pnp){
9894
- this.#binding = new (binding_default()).JsResolverFactory(pnp);
9894
+ constructor(pnp, resolveOptions, loaderResolveOptions){
9895
+ this.#binding = new (binding_default()).JsResolverFactory(pnp, getRawResolve(resolveOptions), getRawResolve(loaderResolveOptions));
9895
9896
  }
9896
- get(type, resolveOptions) {
9897
- let { dependencyCategory, resolveToContext, ...resolve } = resolveOptions || {};
9898
- return new Resolver(this.#binding.get(type, {
9897
+ #create(type, resolveOptionsWithDepType) {
9898
+ let { dependencyType, resolveToContext, ...resolve } = resolveOptionsWithDepType, resolver = new Resolver(this.#binding.get(type, {
9899
9899
  ...getRawResolve(resolve),
9900
- dependencyCategory,
9900
+ dependencyType,
9901
9901
  resolveToContext
9902
- }));
9902
+ })), childCache = new WeakMap();
9903
+ return resolver.withOptions = (options)=>{
9904
+ let cacheEntry = childCache.get(options);
9905
+ if (void 0 !== cacheEntry) return cacheEntry;
9906
+ let mergedOptions = cachedCleverMerge(resolveOptionsWithDepType, options), newResolver = this.get(type, mergedOptions);
9907
+ return childCache.set(options, newResolver), newResolver;
9908
+ }, resolver;
9909
+ }
9910
+ get(type, resolveOptions = EMPTY_RESOLVE_OPTIONS) {
9911
+ let typedCaches = this.#cache.get(type);
9912
+ typedCaches || (typedCaches = {
9913
+ direct: new WeakMap(),
9914
+ stringified: new Map()
9915
+ }, this.#cache.set(type, typedCaches));
9916
+ let cachedResolver = typedCaches.direct.get(resolveOptions);
9917
+ if (cachedResolver) return cachedResolver;
9918
+ let ident = JSON.stringify(resolveOptions), resolver = typedCaches.stringified.get(ident);
9919
+ if (resolver) return typedCaches.direct.set(resolveOptions, resolver), resolver;
9920
+ let newResolver = this.#create(type, resolveOptions);
9921
+ return typedCaches.direct.set(resolveOptions, newResolver), typedCaches.stringified.set(ident, newResolver), newResolver;
9903
9922
  }
9904
9923
  }
9905
9924
  class RuleSetCompiler {
@@ -10251,7 +10270,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10251
10270
  });
10252
10271
  }
10253
10272
  }
10254
- let CORE_VERSION = "1.4.11", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10273
+ let CORE_VERSION = "1.5.0-beta.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10255
10274
 
10256
10275
  Help:
10257
10276
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -10262,6 +10281,119 @@ Help:
10262
10281
  Please ensure the version of @rspack/binding and @rspack/core is the same.
10263
10282
  The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
10264
10283
  `;
10284
+ class NativeWatchFileSystem {
10285
+ #inner;
10286
+ #inputFileSystem;
10287
+ constructor(inputFileSystem){
10288
+ this.#inputFileSystem = inputFileSystem;
10289
+ }
10290
+ watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
10291
+ if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
10292
+ if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
10293
+ if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
10294
+ if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
10295
+ if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
10296
+ let nativeWatcher = this.getNativeWatcher(options);
10297
+ return nativeWatcher.watch([
10298
+ Array.from(files.added),
10299
+ Array.from(files.removed)
10300
+ ], [
10301
+ Array.from(directories.added),
10302
+ Array.from(directories.removed)
10303
+ ], [
10304
+ Array.from(missing.added),
10305
+ Array.from(missing.removed)
10306
+ ], (err, result)=>{
10307
+ if (err) return void callback(err, new Map(), new Map(), new Set(), new Set());
10308
+ nativeWatcher.pause();
10309
+ let changedFiles = result.changedFiles, removedFiles = result.removedFiles;
10310
+ if (this.#inputFileSystem?.purge) {
10311
+ let fs = this.#inputFileSystem;
10312
+ for (let item of changedFiles)fs.purge?.(item);
10313
+ for (let item of removedFiles)fs.purge?.(item);
10314
+ }
10315
+ callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
10316
+ }, (fileName)=>{
10317
+ callbackUndelayed(fileName, Date.now());
10318
+ }), {
10319
+ close: ()=>{
10320
+ nativeWatcher.close().then(()=>{
10321
+ this.#inner = void 0;
10322
+ }, (err)=>{
10323
+ console.error("Error closing native watcher:", err);
10324
+ });
10325
+ },
10326
+ pause: ()=>{
10327
+ nativeWatcher.pause();
10328
+ },
10329
+ getInfo: ()=>({
10330
+ changes: new Set(),
10331
+ removals: new Set(),
10332
+ fileTimeInfoEntries: new Map(),
10333
+ contextTimeInfoEntries: new Map()
10334
+ })
10335
+ };
10336
+ }
10337
+ getNativeWatcher(options) {
10338
+ if (this.#inner) return this.#inner;
10339
+ let nativeWatcherOptions = {
10340
+ followSymlinks: options.followSymlinks,
10341
+ aggregateTimeout: options.aggregateTimeout,
10342
+ pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
10343
+ ignored: ((ignored)=>{
10344
+ if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
10345
+ if ("function" == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
10346
+ })(options.ignored)
10347
+ }, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
10348
+ return this.#inner = nativeWatcher, nativeWatcher;
10349
+ }
10350
+ triggerEvent(kind, path) {
10351
+ this.#inner?.triggerEvent(kind, path);
10352
+ }
10353
+ }
10354
+ let VFILES_BY_COMPILER = new WeakMap();
10355
+ class VirtualModulesPlugin {
10356
+ #staticModules;
10357
+ #compiler;
10358
+ #store;
10359
+ constructor(modules){
10360
+ this.#staticModules = modules || null;
10361
+ }
10362
+ apply(compiler) {
10363
+ this.#compiler = compiler, compiler.hooks.afterEnvironment.tap("VirtualModulesPlugin", ()=>{
10364
+ let record = VFILES_BY_COMPILER.get(compiler) || {};
10365
+ if (this.#staticModules) for (let [filePath, content] of Object.entries(this.#staticModules))record[external_node_path_default().resolve(compiler.context, filePath)] = content;
10366
+ VFILES_BY_COMPILER.set(compiler, record);
10367
+ });
10368
+ }
10369
+ writeModule(filePath, contents) {
10370
+ var compiler, fullPath, time;
10371
+ if (!this.#compiler) throw Error("Plugin has not been initialized");
10372
+ let store = this.getVirtualFileStore(), fullPath1 = external_node_path_default().resolve(this.#compiler.context, filePath);
10373
+ store.writeVirtualFileSync(fullPath1, contents), compiler = this.#compiler, fullPath = fullPath1, time = Date.now(), compiler.watchFileSystem instanceof NativeWatchFileSystem ? compiler.watchFileSystem.triggerEvent("change", fullPath) : function(compiler, fullPath, time) {
10374
+ var fs;
10375
+ if (compiler.watchFileSystem && "watch" in (fs = compiler.watchFileSystem)) {
10376
+ let watcher = compiler.watchFileSystem.watcher;
10377
+ if (!watcher) return;
10378
+ let fileWatcher = watcher.fileWatchers.get(fullPath);
10379
+ fileWatcher && fileWatcher.watcher.emit("change", time, null);
10380
+ }
10381
+ }(compiler, fullPath, time);
10382
+ }
10383
+ getVirtualFileStore() {
10384
+ if (this.#store) return this.#store;
10385
+ let store = this.#compiler?.__internal__get_virtual_file_store();
10386
+ if (!store) throw Error("Virtual file store has not been initialized");
10387
+ return this.#store = store, store;
10388
+ }
10389
+ static __internal__take_virtual_files(compiler) {
10390
+ let record = VFILES_BY_COMPILER.get(compiler);
10391
+ if (record) return VFILES_BY_COMPILER.delete(compiler), Object.entries(record).map(([path, content])=>({
10392
+ path,
10393
+ content
10394
+ }));
10395
+ }
10396
+ }
10265
10397
  class Watching {
10266
10398
  watcher;
10267
10399
  pausedWatcher;
@@ -10524,7 +10656,7 @@ Help:
10524
10656
  "entry"
10525
10657
  ]),
10526
10658
  additionalPass: new lite_tapable_namespaceObject.AsyncSeriesHook([])
10527
- }, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault()), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
10659
+ }, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
10528
10660
  }
10529
10661
  get recordsInputPath() {
10530
10662
  return unsupported("Compiler.recordsInputPath");
@@ -10695,6 +10827,9 @@ Help:
10695
10827
  let compilation = COMPILATION_WEAK_MAP.get(native);
10696
10828
  return compilation || ((compilation = new Compilation(this, native)).name = this.name, COMPILATION_WEAK_MAP.set(native, compilation)), this.#compilation = compilation, compilation;
10697
10829
  }
10830
+ __internal__get_virtual_file_store() {
10831
+ return this.#instance?.getVirtualFileStore();
10832
+ }
10698
10833
  #resetThisCompilation() {
10699
10834
  this.#compilation = void 0, this.hooks.thisCompilation.intercept({
10700
10835
  call: ()=>{}
@@ -10797,7 +10932,7 @@ Help:
10797
10932
  __references: {}
10798
10933
  };
10799
10934
  })(options, this);
10800
- rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
10935
+ rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
10801
10936
  let instanceBinding = __webpack_require__("@rspack/binding");
10802
10937
  this.#registers = this.#createHooksRegisters();
10803
10938
  let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
@@ -11062,19 +11197,8 @@ Help:
11062
11197
  return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
11063
11198
  }, function(queried) {
11064
11199
  return async function(resolveData) {
11065
- let normalizedResolveData = {
11066
- contextInfo: {
11067
- issuer: resolveData.issuer,
11068
- issuerLayer: resolveData.issuerLayer ?? null
11069
- },
11070
- request: resolveData.request,
11071
- context: resolveData.context,
11072
- fileDependencies: [],
11073
- missingDependencies: [],
11074
- contextDependencies: []
11075
- }, ret = await queried.promise(normalizedResolveData);
11076
- return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
11077
- ret,
11200
+ return [
11201
+ await queried.promise(resolveData),
11078
11202
  resolveData
11079
11203
  ];
11080
11204
  };
@@ -11083,36 +11207,14 @@ Help:
11083
11207
  return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
11084
11208
  }, function(queried) {
11085
11209
  return async function(resolveData) {
11086
- let normalizedResolveData = {
11087
- contextInfo: {
11088
- issuer: resolveData.issuer,
11089
- issuerLayer: resolveData.issuerLayer ?? null
11090
- },
11091
- request: resolveData.request,
11092
- context: resolveData.context,
11093
- fileDependencies: [],
11094
- missingDependencies: [],
11095
- contextDependencies: []
11096
- };
11097
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11210
+ return await queried.promise(resolveData), resolveData;
11098
11211
  };
11099
11212
  }),
11100
11213
  registerNormalModuleFactoryResolveTaps: createTap2(binding_default().RegisterJsTapKind.NormalModuleFactoryResolve, function() {
11101
11214
  return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
11102
11215
  }, function(queried) {
11103
11216
  return async function(resolveData) {
11104
- let normalizedResolveData = {
11105
- contextInfo: {
11106
- issuer: resolveData.issuer,
11107
- issuerLayer: resolveData.issuerLayer ?? null
11108
- },
11109
- request: resolveData.request,
11110
- context: resolveData.context,
11111
- fileDependencies: [],
11112
- missingDependencies: [],
11113
- contextDependencies: []
11114
- };
11115
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11217
+ return await queried.promise(resolveData), resolveData;
11116
11218
  };
11117
11219
  }),
11118
11220
  registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_default().RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
@@ -11128,11 +11230,10 @@ Help:
11128
11230
  registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_default().RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
11129
11231
  return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
11130
11232
  }, function(queried) {
11131
- return async function(arg) {
11132
- let data = JSON.parse(arg);
11233
+ return async function(resolveData) {
11133
11234
  return [
11134
- await queried.promise(data),
11135
- data.createData
11235
+ await queried.promise(resolveData),
11236
+ resolveData
11136
11237
  ];
11137
11238
  };
11138
11239
  }),
@@ -11449,7 +11550,7 @@ Help:
11449
11550
  obj.children = this.stats.map((stat, idx)=>{
11450
11551
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11451
11552
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11452
- }), childOptions.version && (obj.rspackVersion = "1.4.11", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11553
+ }), childOptions.version && (obj.rspackVersion = "1.5.0-beta.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11453
11554
  let mapError = (j, obj)=>({
11454
11555
  ...obj,
11455
11556
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -12349,7 +12450,7 @@ Help:
12349
12450
  object.hash = context.getStatsCompilation(compilation).hash;
12350
12451
  },
12351
12452
  version: (object)=>{
12352
- object.version = "5.75.0", object.rspackVersion = "1.4.11";
12453
+ object.version = "5.75.0", object.rspackVersion = "1.5.0-beta.1";
12353
12454
  },
12354
12455
  env: (object, _compilation, _context, { _env })=>{
12355
12456
  object.env = _env;
@@ -13929,24 +14030,6 @@ Help:
13929
14030
  });
13930
14031
  }
13931
14032
  }
13932
- class NormalModuleReplacementPlugin {
13933
- resourceRegExp;
13934
- newResource;
13935
- constructor(resourceRegExp, newResource){
13936
- this.resourceRegExp = resourceRegExp, this.newResource = newResource;
13937
- }
13938
- apply(compiler) {
13939
- let { resourceRegExp, newResource } = this;
13940
- compiler.hooks.normalModuleFactory.tap("NormalModuleReplacementPlugin", (nmf)=>{
13941
- nmf.hooks.beforeResolve.tap("NormalModuleReplacementPlugin", (result)=>{
13942
- resourceRegExp.test(result.request) && ("function" == typeof newResource ? newResource(result) : result.request = newResource);
13943
- }), nmf.hooks.afterResolve.tap("NormalModuleReplacementPlugin", (result)=>{
13944
- let createData = result.createData || {};
13945
- resourceRegExp.test(createData.resource || "") && ("function" == typeof newResource ? newResource(result) : external_node_path_namespaceObject.posix.isAbsolute(newResource) || external_node_path_namespaceObject.win32.isAbsolute(newResource) ? createData.resource = newResource : createData.resource = external_node_path_namespaceObject.join(external_node_path_namespaceObject.dirname(createData.resource || ""), newResource));
13946
- });
13947
- });
13948
- }
13949
- }
13950
14033
  var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
13951
14034
  let filterToFunction = (item)=>{
13952
14035
  if ("string" == typeof item) {
@@ -13964,59 +14047,6 @@ Help:
13964
14047
  true: 2,
13965
14048
  verbose: 1
13966
14049
  };
13967
- class NativeWatchFileSystem {
13968
- #inner;
13969
- watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
13970
- if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
13971
- if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
13972
- if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
13973
- if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
13974
- if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
13975
- let nativeWatcher = this.getNativeWatcher(options);
13976
- return nativeWatcher.watch([
13977
- Array.from(files.added),
13978
- Array.from(files.removed)
13979
- ], [
13980
- Array.from(directories.added),
13981
- Array.from(directories.removed)
13982
- ], [
13983
- Array.from(missing.added),
13984
- Array.from(missing.removed)
13985
- ], (err, result)=>{
13986
- let { changedFiles, removedFiles } = result;
13987
- callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
13988
- }, (fileName)=>{
13989
- callbackUndelayed(fileName, Date.now());
13990
- }), {
13991
- close: ()=>{
13992
- nativeWatcher.close();
13993
- },
13994
- pause: ()=>{
13995
- nativeWatcher.pause();
13996
- },
13997
- getInfo: ()=>({
13998
- changes: new Set(),
13999
- removals: new Set(),
14000
- fileTimeInfoEntries: new Map(),
14001
- contextTimeInfoEntries: new Map()
14002
- })
14003
- };
14004
- }
14005
- getNativeWatcher(options) {
14006
- if (this.#inner) return this.#inner;
14007
- let nativeWatcherOptions = {
14008
- followSymlinks: options.followSymlinks,
14009
- aggregateTimeout: options.aggregateTimeout,
14010
- pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
14011
- ignored: ((ignored)=>{
14012
- if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
14013
- if ("function" == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
14014
- if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
14015
- })(options.ignored)
14016
- }, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
14017
- return this.#inner = nativeWatcher, nativeWatcher;
14018
- }
14019
- }
14020
14050
  class NodeWatchFileSystem {
14021
14051
  inputFileSystem;
14022
14052
  watcherOptions;
@@ -14270,7 +14300,7 @@ Help:
14270
14300
  })
14271
14301
  });
14272
14302
  let inputFileSystem = new (CachedInputFileSystem_default())(graceful_fs_index_js_default(), 60000);
14273
- compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem() : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
14303
+ compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem(inputFileSystem) : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
14274
14304
  compiler.inputFileSystem === inputFileSystem && (compiler.fsStartTime = Date.now(), inputFileSystem.purge?.());
14275
14305
  });
14276
14306
  }
@@ -14444,7 +14474,7 @@ Help:
14444
14474
  const_to_let: schemas_boolean(),
14445
14475
  module: schemas_boolean()
14446
14476
  }).partial(), ZodSwcTerserMangleOptions = strictObject({
14447
- props: record(schemas_string(), any()),
14477
+ props: schemas_record(schemas_string(), any()),
14448
14478
  topLevel: schemas_boolean(),
14449
14479
  toplevel: schemas_boolean(),
14450
14480
  keepClassNames: schemas_boolean(),
@@ -14473,14 +14503,14 @@ Help:
14473
14503
  ]),
14474
14504
  importSource: schemas_string()
14475
14505
  }).partial(), ZodSwcConstModulesConfig = strictObject({
14476
- globals: record(schemas_string(), record(schemas_string(), schemas_string())).optional()
14506
+ globals: schemas_record(schemas_string(), schemas_record(schemas_string(), schemas_string())).optional()
14477
14507
  }), ZodSwcGlobalPassOption = strictObject({
14478
- vars: record(schemas_string(), schemas_string()),
14508
+ vars: schemas_record(schemas_string(), schemas_string()),
14479
14509
  envs: union([
14480
14510
  schemas_string().array(),
14481
- record(schemas_string(), schemas_string())
14511
+ schemas_record(schemas_string(), schemas_string())
14482
14512
  ]),
14483
- typeofs: record(schemas_string(), schemas_string())
14513
+ typeofs: schemas_record(schemas_string(), schemas_string())
14484
14514
  }).partial(), ZodSwcOptimizerConfig = strictObject({
14485
14515
  simplify: schemas_boolean(),
14486
14516
  globals: ZodSwcGlobalPassOption,
@@ -14537,7 +14567,7 @@ Help:
14537
14567
  cacheRoot: schemas_string(),
14538
14568
  plugins: schemas_array(tuple([
14539
14569
  schemas_string(),
14540
- record(schemas_string(), any())
14570
+ schemas_record(schemas_string(), any())
14541
14571
  ])),
14542
14572
  runPluginFirst: schemas_boolean(),
14543
14573
  disableBuiltinTransformsForInternalTesting: schemas_boolean(),
@@ -14546,7 +14576,7 @@ Help:
14546
14576
  keepImportAssertions: schemas_boolean()
14547
14577
  }).partial(),
14548
14578
  baseUrl: schemas_string(),
14549
- paths: record(schemas_string(), schemas_string().array()),
14579
+ paths: schemas_record(schemas_string(), schemas_string().array()),
14550
14580
  minify: ZodSwcJsMinifyOptions,
14551
14581
  preserveAllComments: schemas_boolean(),
14552
14582
  output: strictObject({
@@ -14586,7 +14616,7 @@ Help:
14586
14616
  type: literal("commonjs")
14587
14617
  }), ZodSwcUmdConfig = ZodSwcBaseModuleConfig.extend({
14588
14618
  type: literal("umd"),
14589
- globals: record(schemas_string(), schemas_string()).optional()
14619
+ globals: schemas_record(schemas_string(), schemas_string()).optional()
14590
14620
  }), ZodSwcAmdConfig = ZodSwcBaseModuleConfig.extend({
14591
14621
  type: literal("amd"),
14592
14622
  moduleId: schemas_string().optional()
@@ -14736,7 +14766,7 @@ Help:
14736
14766
  library: libraryOptions.optional(),
14737
14767
  dependOn: entryDependOn.optional(),
14738
14768
  layer: layer.optional()
14739
- }), entryStatic = record(schemas_string(), entryItem.or(entryDescription)).or(entryItem), entry = entryStatic.or(anyFunction), path = schemas_string(), pathinfo = schemas_boolean().or(literal("verbose")), webassemblyModuleFilename = schemas_string(), crossOriginLoading = literal(!1).or(schemas_enum([
14769
+ }), entryStatic = schemas_record(schemas_string(), entryItem.or(entryDescription)).or(entryItem), entry = entryStatic.or(anyFunction), path = schemas_string(), pathinfo = schemas_boolean().or(literal("verbose")), webassemblyModuleFilename = schemas_string(), crossOriginLoading = literal(!1).or(schemas_enum([
14740
14770
  "anonymous",
14741
14771
  "use-credentials"
14742
14772
  ])), hotUpdateGlobal = schemas_string(), uniqueName = schemas_string(), chunkLoadingGlobal = schemas_string(), enabledLibraryTypes = schemas_array(libraryType), clean = union([
@@ -14826,7 +14856,7 @@ Help:
14826
14856
  charset: schemas_boolean(),
14827
14857
  environment: environment,
14828
14858
  compareBeforeEmit: schemas_boolean()
14829
- }).partial(), resolveAlias = record(schemas_string(), literal(!1).or(schemas_string()).or(schemas_array(schemas_string().or(literal(!1))))).or(literal(!1)), resolveTsConfigFile = schemas_string(), resolveTsConfig = resolveTsConfigFile.or(strictObject({
14859
+ }).partial(), resolveAlias = schemas_record(schemas_string(), literal(!1).or(schemas_string()).or(schemas_array(schemas_string().or(literal(!1))))).or(literal(!1)), resolveTsConfigFile = schemas_string(), resolveTsConfig = resolveTsConfigFile.or(strictObject({
14830
14860
  configFile: resolveTsConfigFile,
14831
14861
  references: schemas_array(schemas_string()).or(literal("auto")).optional()
14832
14862
  })), resolveOptions = strictObject({
@@ -14846,18 +14876,18 @@ Help:
14846
14876
  tsConfig: resolveTsConfig,
14847
14877
  fullySpecified: schemas_boolean(),
14848
14878
  exportsFields: schemas_array(schemas_string()),
14849
- extensionAlias: record(schemas_string(), schemas_string().or(schemas_array(schemas_string()))),
14879
+ extensionAlias: schemas_record(schemas_string(), schemas_string().or(schemas_array(schemas_string()))),
14850
14880
  aliasFields: schemas_array(schemas_string()),
14851
14881
  restrictions: schemas_array(schemas_string()),
14852
14882
  roots: schemas_array(schemas_string()),
14853
14883
  pnp: schemas_boolean()
14854
14884
  }).partial().extend({
14855
- byDependency: lazy(()=>record(schemas_string(), resolveOptions)).optional()
14885
+ byDependency: lazy(()=>schemas_record(schemas_string(), resolveOptions)).optional()
14856
14886
  }), ruleSetCondition = _instanceof(RegExp).or(schemas_string()).or(anyFunction).or(lazy(()=>ruleSetConditions)).or(lazy(()=>ruleSetLogicalConditions)), ruleSetConditions = lazy(()=>schemas_array(ruleSetCondition)), ruleSetLogicalConditions = strictObject({
14857
14887
  and: ruleSetConditions,
14858
14888
  or: ruleSetConditions,
14859
14889
  not: ruleSetCondition
14860
- }).partial(), ruleSetLoader = schemas_string(), ruleSetLoaderOptions = schemas_string().or(record(schemas_string(), any())), ruleSetLoaderWithOptions = strictObject({
14890
+ }).partial(), ruleSetLoader = schemas_string(), ruleSetLoaderOptions = schemas_string().or(schemas_record(schemas_string(), any())), ruleSetLoaderWithOptions = strictObject({
14861
14891
  ident: schemas_string().optional(),
14862
14892
  loader: ruleSetLoader,
14863
14893
  options: ruleSetLoaderOptions.optional(),
@@ -14891,15 +14921,15 @@ Help:
14891
14921
  resourceQuery: ruleSetCondition,
14892
14922
  scheme: ruleSetCondition,
14893
14923
  mimetype: ruleSetCondition,
14894
- descriptionData: record(schemas_string(), ruleSetCondition),
14895
- with: record(schemas_string(), ruleSetCondition),
14924
+ descriptionData: schemas_record(schemas_string(), ruleSetCondition),
14925
+ with: schemas_record(schemas_string(), ruleSetCondition),
14896
14926
  type: schemas_string(),
14897
14927
  layer: schemas_string(),
14898
14928
  loader: ruleSetLoader,
14899
14929
  options: ruleSetLoaderOptions,
14900
14930
  use: ruleSetUse,
14901
- parser: record(schemas_string(), any()),
14902
- generator: record(schemas_string(), any()),
14931
+ parser: schemas_record(schemas_string(), any()),
14932
+ generator: schemas_record(schemas_string(), any()),
14903
14933
  resolve: resolveOptions,
14904
14934
  sideEffects: schemas_boolean(),
14905
14935
  enforce: literal("pre").or(literal("post"))
@@ -14937,7 +14967,7 @@ Help:
14937
14967
  ]), javascriptParserUrl = union([
14938
14968
  literal("relative"),
14939
14969
  schemas_boolean()
14940
- ]), exprContextCritical = schemas_boolean(), wrappedContextCritical = schemas_boolean(), wrappedContextRegExp = _instanceof(RegExp), exportsPresence = schemas_enum([
14970
+ ]), exprContextCritical = schemas_boolean(), wrappedContextCritical = schemas_boolean(), unknownContextCritical = schemas_boolean(), wrappedContextRegExp = _instanceof(RegExp), exportsPresence = schemas_enum([
14941
14971
  "error",
14942
14972
  "warn",
14943
14973
  "auto"
@@ -14965,6 +14995,7 @@ Help:
14965
14995
  url: javascriptParserUrl,
14966
14996
  exprContextCritical: exprContextCritical,
14967
14997
  wrappedContextCritical: wrappedContextCritical,
14998
+ unknownContextCritical: unknownContextCritical,
14968
14999
  wrappedContextRegExp: wrappedContextRegExp,
14969
15000
  exportsPresence: exportsPresence,
14970
15001
  importExportsPresence: importExportsPresence,
@@ -15077,12 +15108,12 @@ Help:
15077
15108
  literal(!1),
15078
15109
  allowTarget,
15079
15110
  allowTarget.array()
15080
- ]), externalItemObjectValue = record(schemas_string(), schemas_string().or(schemas_string().array())), externalItemUmdValue = strictObject({
15111
+ ]), externalItemObjectValue = schemas_record(schemas_string(), schemas_string().or(schemas_string().array())), externalItemUmdValue = strictObject({
15081
15112
  root: schemas_string().or(schemas_string().array()),
15082
15113
  commonjs: schemas_string().or(schemas_string().array()),
15083
15114
  commonjs2: schemas_string().or(schemas_string().array()),
15084
15115
  amd: schemas_string().or(schemas_string().array())
15085
- }), externalItemValue = schemas_string().or(schemas_boolean()).or(schemas_string().array().min(1)).or(externalItemObjectValue), externalItemObjectUnknown = record(schemas_string(), externalItemValue), externalItem = schemas_string().or(_instanceof(RegExp)).or(externalItemObjectUnknown).or(anyFunction), externals = externalItem.array().or(externalItem), externalsPresets = strictObject({
15116
+ }), externalItemValue = schemas_string().or(schemas_boolean()).or(schemas_string().array().min(1)).or(externalItemObjectValue), externalItemObjectUnknown = schemas_record(schemas_string(), externalItemValue), externalItem = schemas_string().or(_instanceof(RegExp)).or(externalItemObjectUnknown).or(anyFunction), externals = externalItem.array().or(externalItem), externalsPresets = strictObject({
15086
15117
  node: schemas_boolean(),
15087
15118
  web: schemas_boolean(),
15088
15119
  webAsync: schemas_boolean(),
@@ -15121,7 +15152,7 @@ Help:
15121
15152
  "node-module"
15122
15153
  ])),
15123
15154
  global: schemas_boolean().or(literal("warn"))
15124
- }).partial(), node = literal(!1).or(nodeOptions), loader = record(schemas_string(), any()), snapshotOptions = strictObject({}), cacheOptions = schemas_boolean(), statsPresets = schemas_enum([
15155
+ }).partial(), node = literal(!1).or(nodeOptions), loader = schemas_record(schemas_string(), any()), snapshotOptions = strictObject({}), cacheOptions = schemas_boolean(), statsPresets = schemas_enum([
15125
15156
  "normal",
15126
15157
  "none",
15127
15158
  "verbose",
@@ -15226,7 +15257,7 @@ Help:
15226
15257
  "initial",
15227
15258
  "async",
15228
15259
  "all"
15229
- ]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
15260
+ ]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(schemas_record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
15230
15261
  chunks: optimizationSplitChunksChunks,
15231
15262
  defaultSizeTypes: schemas_array(schemas_string()),
15232
15263
  minChunks: schemas_number().min(1).or(literal(1 / 0)),
@@ -15251,7 +15282,7 @@ Help:
15251
15282
  layer: schemas_string().or(_instanceof(RegExp)).or(anyFunction),
15252
15283
  ...sharedOptimizationSplitChunksCacheGroup
15253
15284
  }).partial(), optimizationSplitChunksOptions = strictObject({
15254
- cacheGroups: record(schemas_string(), literal(!1).or(optimizationSplitChunksCacheGroup)),
15285
+ cacheGroups: schemas_record(schemas_string(), literal(!1).or(optimizationSplitChunksCacheGroup)),
15255
15286
  fallbackCacheGroup: strictObject({
15256
15287
  chunks: optimizationSplitChunksChunks,
15257
15288
  minSize: numberOrInfinity,
@@ -15388,6 +15419,7 @@ Help:
15388
15419
  inlineConst: schemas_boolean(),
15389
15420
  inlineEnum: schemas_boolean(),
15390
15421
  typeReexportsPresence: schemas_boolean(),
15422
+ lazyBarrel: schemas_boolean(),
15391
15423
  nativeWatcher: schemas_boolean()
15392
15424
  }).partial(), watch = schemas_boolean(), watchOptions = strictObject({
15393
15425
  aggregateTimeout: numberOrInfinity,
@@ -15399,7 +15431,7 @@ Help:
15399
15431
  file: _instanceof(RegExp).optional(),
15400
15432
  message: _instanceof(RegExp).optional(),
15401
15433
  module: _instanceof(RegExp).optional()
15402
- })).array(), profile = schemas_boolean(), amd = literal(!1).or(record(schemas_string(), any())), bail = schemas_boolean(), performance = strictObject({
15434
+ })).array(), profile = schemas_boolean(), amd = literal(!1).or(schemas_record(schemas_string(), any())), bail = schemas_boolean(), performance = strictObject({
15403
15435
  assetFilter: anyFunction,
15404
15436
  hints: schemas_enum([
15405
15437
  "error",
@@ -15443,7 +15475,8 @@ Help:
15443
15475
  profile: profile,
15444
15476
  amd: amd,
15445
15477
  bail: bail,
15446
- performance: performance
15478
+ performance: performance,
15479
+ lazyCompilation: schemas_boolean().or(lazyCompilationOptions).optional()
15447
15480
  }).partial().check((ctx)=>{
15448
15481
  let config = ctx.value, library = config?.output?.library;
15449
15482
  function checkExternalItem(externalItem, path) {
@@ -15730,7 +15763,7 @@ Help:
15730
15763
  let _options = JSON.stringify(options || {});
15731
15764
  return binding_default().transform(source, _options);
15732
15765
  }
15733
- let exports_rspackVersion = "1.4.11", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15766
+ let exports_rspackVersion = "1.5.0-beta.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15734
15767
  getNormalizedRspackOptions: getNormalizedRspackOptions,
15735
15768
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
15736
15769
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -15927,15 +15960,16 @@ Help:
15927
15960
  SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
15928
15961
  lazyCompilationMiddleware: (compiler)=>{
15929
15962
  if (compiler instanceof MultiCompiler) {
15930
- let middlewareByCompiler = new Map(), i = 0;
15963
+ let middlewareByCompiler = new Map(), i = 0, isReportDeprecatedWarned = !1, isReportRepeatWarned = !1;
15931
15964
  for (let c of compiler.compilers){
15932
- if (!c.options.experiments.lazyCompilation) continue;
15965
+ if (c.options.experiments.lazyCompilation && (c.name ? console.warn(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : isReportDeprecatedWarned || (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), isReportDeprecatedWarned = !0)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? console.warn(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : isReportRepeatWarned || (console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN), isReportRepeatWarned = !0)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
15933
15966
  let options = {
15934
- ...c.options.experiments.lazyCompilation
15967
+ ...c.options.experiments.lazyCompilation,
15968
+ ...c.options.lazyCompilation
15935
15969
  }, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
15936
15970
  options.prefix = `${prefix}__${i++}`;
15937
- let activeModules = new Map(), filesByKey = new Map(), indexToModule = new Map(), moduleToIndex = new Map();
15938
- middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, indexToModule, activeModules, filesByKey, options.prefix)), applyPlugin(c, moduleToIndex, indexToModule, options, activeModules, filesByKey);
15971
+ let activeModules = new Set(), filesByKey = new Map();
15972
+ middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix)), applyPlugin(c, options, activeModules, filesByKey);
15939
15973
  }
15940
15974
  let keys = [
15941
15975
  ...middlewareByCompiler.keys()
@@ -15947,11 +15981,12 @@ Help:
15947
15981
  return middleware?.(req, res, next);
15948
15982
  };
15949
15983
  }
15950
- if (!compiler.options.experiments.lazyCompilation) return noop;
15951
- let activeModules = new Map(), filesByKey = new Map(), indexToMap = new Map(), moduleToIndex = new Map(), options = {
15952
- ...compiler.options.experiments.lazyCompilation
15984
+ if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
15985
+ let activeModules = new Set(), filesByKey = new Map(), options = {
15986
+ ...compiler.options.experiments.lazyCompilation,
15987
+ ...compiler.options.lazyCompilation
15953
15988
  };
15954
- return applyPlugin(compiler, moduleToIndex, indexToMap, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, indexToMap, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
15989
+ return applyPlugin(compiler, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
15955
15990
  },
15956
15991
  swc: {
15957
15992
  minify: minify,
@@ -15965,11 +16000,18 @@ Help:
15965
16000
  return binding_default().transformSync(source, _options);
15966
16001
  }
15967
16002
  },
16003
+ resolver: {
16004
+ ResolverFactory: binding_.ResolverFactory,
16005
+ EnforceExtension: binding_.EnforceExtension,
16006
+ async: binding_.async,
16007
+ sync: binding_.sync
16008
+ },
15968
16009
  CssChunkingPlugin: CssChunkingPlugin,
15969
16010
  createNativePlugin: function(name, resolve, affectedHooks) {
15970
16011
  if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
15971
16012
  return base_create(name, resolve, affectedHooks);
15972
- }
16013
+ },
16014
+ VirtualModulesPlugin: VirtualModulesPlugin
15973
16015
  };
15974
16016
  function createCompiler(userOptions) {
15975
16017
  var options;