@rspack/core 1.1.8 → 1.2.0-beta.0

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 (86) hide show
  1. package/compiled/@swc/types/index.d.ts +20 -5
  2. package/compiled/@swc/types/license +1 -1
  3. package/compiled/@swc/types/package.json +1 -1
  4. package/dist/Chunk.d.ts +21 -28
  5. package/dist/ChunkGraph.d.ts +8 -4
  6. package/dist/ChunkGroup.d.ts +13 -19
  7. package/dist/Compilation.d.ts +5 -9
  8. package/dist/Compiler.d.ts +1 -0
  9. package/dist/Entrypoint.d.ts +4 -3
  10. package/dist/ExportsInfo.d.ts +20 -0
  11. package/dist/FileSystem.d.ts +17 -17
  12. package/dist/Module.d.ts +6 -8
  13. package/dist/ModuleGraph.d.ts +6 -0
  14. package/dist/ModuleGraphConnection.d.ts +11 -0
  15. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +8 -10
  29. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/EntryPlugin.d.ts +11 -3
  36. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +8 -10
  56. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  59. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/base.d.ts +1 -1
  72. package/dist/builtin-plugin/css-extract/index.d.ts +1 -0
  73. package/dist/builtin-plugin/index.d.ts +1 -0
  74. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  75. package/dist/config/adapter.d.ts +2 -4
  76. package/dist/config/adapterRuleUse.d.ts +32 -8
  77. package/dist/config/normalization.d.ts +18 -2
  78. package/dist/config/types.d.ts +33 -11
  79. package/dist/config/zod.d.ts +1279 -1253
  80. package/dist/container/ContainerPlugin.d.ts +1 -1
  81. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  82. package/dist/exports.d.ts +1 -0
  83. package/dist/index.js +1376 -1379
  84. package/dist/util/hash/wasm-hash.d.ts +1 -1
  85. package/dist/util/identifier.d.ts +0 -36
  86. package/package.json +8 -7
package/dist/index.js CHANGED
@@ -148,15 +148,15 @@ var require_CachedInputFileSystem = __commonJS({
148
148
  "../../node_modules/.pnpm/enhanced-resolve@5.17.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"(exports2, module2) {
149
149
  "use strict";
150
150
  var nextTick = require("process").nextTick;
151
- var dirname4 = (path10) => {
152
- let idx = path10.length - 1;
151
+ var dirname4 = (path11) => {
152
+ let idx = path11.length - 1;
153
153
  while (idx >= 0) {
154
- const c = path10.charCodeAt(idx);
154
+ const c = path11.charCodeAt(idx);
155
155
  if (c === 47 || c === 92) break;
156
156
  idx--;
157
157
  }
158
158
  if (idx < 0) return "";
159
- return path10.slice(0, idx);
159
+ return path11.slice(0, idx);
160
160
  };
161
161
  var runCallbacks = (callbacks, err, result2) => {
162
162
  if (callbacks.length === 1) {
@@ -193,13 +193,13 @@ var require_CachedInputFileSystem = __commonJS({
193
193
  * @param {FileSystemCallback<any>=} callback callback
194
194
  * @returns {any} result
195
195
  */
196
- (path10, options, callback) => {
196
+ (path11, options, callback) => {
197
197
  if (typeof options === "function") {
198
198
  callback = /** @type {FileSystemCallback<any>} */
199
199
  options;
200
200
  options = void 0;
201
201
  }
202
- if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
202
+ if (typeof path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "number") {
203
203
  callback(
204
204
  new TypeError("path must be a string, Buffer, URL or number")
205
205
  );
@@ -210,26 +210,26 @@ var require_CachedInputFileSystem = __commonJS({
210
210
  /** @type {Function} */
211
211
  this._provider.call(
212
212
  this._providerContext,
213
- path10,
213
+ path11,
214
214
  options,
215
215
  callback
216
216
  )
217
217
  );
218
218
  }
219
- let callbacks = this._activeAsyncOperations.get(path10);
219
+ let callbacks = this._activeAsyncOperations.get(path11);
220
220
  if (callbacks) {
221
221
  callbacks.push(callback);
222
222
  return;
223
223
  }
224
- this._activeAsyncOperations.set(path10, callbacks = [callback]);
224
+ this._activeAsyncOperations.set(path11, callbacks = [callback]);
225
225
  provider(
226
- path10,
226
+ path11,
227
227
  /**
228
228
  * @param {Error} err error
229
229
  * @param {any} result result
230
230
  */
231
231
  (err, result2) => {
232
- this._activeAsyncOperations.delete(path10);
232
+ this._activeAsyncOperations.delete(path11);
233
233
  runCallbacks(callbacks, err, result2);
234
234
  }
235
235
  );
@@ -241,12 +241,12 @@ var require_CachedInputFileSystem = __commonJS({
241
241
  * @param {object=} options options
242
242
  * @returns {any} result
243
243
  */
244
- (path10, options) => {
244
+ (path11, options) => {
245
245
  return (
246
246
  /** @type {Function} */
247
247
  this._syncProvider.call(
248
248
  this._providerContext,
249
- path10,
249
+ path11,
250
250
  options
251
251
  )
252
252
  );
@@ -292,22 +292,22 @@ var require_CachedInputFileSystem = __commonJS({
292
292
  * @param {FileSystemCallback<any>} callback callback
293
293
  * @returns {void}
294
294
  */
295
- provide(path10, options, callback) {
295
+ provide(path11, options, callback) {
296
296
  if (typeof options === "function") {
297
297
  callback = options;
298
298
  options = void 0;
299
299
  }
300
- if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
300
+ if (typeof path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "number") {
301
301
  callback(new TypeError("path must be a string, Buffer, URL or number"));
302
302
  return;
303
303
  }
304
- const strPath = typeof path10 !== "string" ? path10.toString() : path10;
304
+ const strPath = typeof path11 !== "string" ? path11.toString() : path11;
305
305
  if (options) {
306
306
  return (
307
307
  /** @type {Function} */
308
308
  this._provider.call(
309
309
  this._providerContext,
310
- path10,
310
+ path11,
311
311
  options,
312
312
  callback
313
313
  )
@@ -329,7 +329,7 @@ var require_CachedInputFileSystem = __commonJS({
329
329
  this._activeAsyncOperations.set(strPath, callbacks = [callback]);
330
330
  this._provider.call(
331
331
  this._providerContext,
332
- path10,
332
+ path11,
333
333
  /**
334
334
  * @param {Error | null} err error
335
335
  * @param {any} [result] result
@@ -352,17 +352,17 @@ var require_CachedInputFileSystem = __commonJS({
352
352
  * @param {any} options options
353
353
  * @returns {any} result
354
354
  */
355
- provideSync(path10, options) {
356
- if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
355
+ provideSync(path11, options) {
356
+ if (typeof path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "number") {
357
357
  throw new TypeError("path must be a string");
358
358
  }
359
- const strPath = typeof path10 !== "string" ? path10.toString() : path10;
359
+ const strPath = typeof path11 !== "string" ? path11.toString() : path11;
360
360
  if (options) {
361
361
  return (
362
362
  /** @type {Function} */
363
363
  this._syncProvider.call(
364
364
  this._providerContext,
365
- path10,
365
+ path11,
366
366
  options
367
367
  )
368
368
  );
@@ -382,7 +382,7 @@ var require_CachedInputFileSystem = __commonJS({
382
382
  result2 = /** @type {Function} */
383
383
  this._syncProvider.call(
384
384
  this._providerContext,
385
- path10
385
+ path11
386
386
  );
387
387
  } catch (err) {
388
388
  this._storeResult(
@@ -471,11 +471,11 @@ var require_CachedInputFileSystem = __commonJS({
471
471
  * @param {Error | null} err error
472
472
  * @param {any} result result
473
473
  */
474
- _storeResult(path10, err, result2) {
475
- if (this._data.has(path10)) return;
474
+ _storeResult(path11, err, result2) {
475
+ if (this._data.has(path11)) return;
476
476
  const level = this._levels[this._currentLevel];
477
- this._data.set(path10, { err, result: result2, level });
478
- level.add(path10);
477
+ this._data.set(path11, { err, result: result2, level });
478
+ level.add(path11);
479
479
  }
480
480
  _decayLevel() {
481
481
  const nextLevel = (this._currentLevel + 1) % this._levels.length;
@@ -610,8 +610,8 @@ var require_CachedInputFileSystem = __commonJS({
610
610
  * @param {string} path path
611
611
  * @param {FileSystemCallback<any>} callback
612
612
  */
613
- ((path10, callback) => {
614
- this.readFile(path10, (err, buffer) => {
613
+ ((path11, callback) => {
614
+ this.readFile(path11, (err, buffer) => {
615
615
  if (err) return callback(err);
616
616
  if (!buffer || buffer.length === 0)
617
617
  return callback(new Error("No file content"));
@@ -632,8 +632,8 @@ var require_CachedInputFileSystem = __commonJS({
632
632
  * @param {string} path path
633
633
  * @returns {any} result
634
634
  */
635
- ((path10) => {
636
- const buffer = this.readFileSync(path10);
635
+ ((path11) => {
636
+ const buffer = this.readFileSync(path11);
637
637
  const data = JSON.parse(buffer.toString("utf-8"));
638
638
  return data;
639
639
  }),
@@ -727,6 +727,7 @@ __export(src_exports, {
727
727
  SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
728
728
  Template: () => Template,
729
729
  ValidationError: () => ValidationError2,
730
+ WarnCaseSensitiveModulesPlugin: () => WarnCaseSensitiveModulesPlugin,
730
731
  WebpackError: () => WebpackError2,
731
732
  WebpackOptionsApply: () => RspackOptionsApply,
732
733
  config: () => config,
@@ -791,6 +792,7 @@ __export(exports_exports, {
791
792
  SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
792
793
  Template: () => Template,
793
794
  ValidationError: () => ValidationError2,
795
+ WarnCaseSensitiveModulesPlugin: () => WarnCaseSensitiveModulesPlugin,
794
796
  WebpackError: () => WebpackError2,
795
797
  WebpackOptionsApply: () => RspackOptionsApply,
796
798
  config: () => config,
@@ -813,281 +815,8 @@ __export(exports_exports, {
813
815
  var import_package = require("../package.json");
814
816
 
815
817
  // src/Compilation.ts
816
- var import_binding6 = require("@rspack/binding");
817
- var liteTapable = __toESM(require("@rspack/lite-tapable"));
818
-
819
- // src/Chunk.ts
820
- var import_binding2 = require("@rspack/binding");
821
-
822
- // src/ChunkGroup.ts
823
818
  var import_binding = require("@rspack/binding");
824
- var ChunkGroup = class _ChunkGroup {
825
- #inner;
826
- #innerCompilation;
827
- static __from_binding(chunk, compilation) {
828
- return new _ChunkGroup(chunk, compilation);
829
- }
830
- constructor(inner, compilation) {
831
- this.#inner = inner;
832
- this.#innerCompilation = compilation;
833
- }
834
- getFiles() {
835
- const files = /* @__PURE__ */ new Set();
836
- for (const chunk of this.#inner.chunks) {
837
- for (const file of chunk.files) {
838
- files.add(file);
839
- }
840
- }
841
- return Array.from(files);
842
- }
843
- getParents() {
844
- return this.#inner.__inner_parents.map((parent) => {
845
- const cg = (0, import_binding.__chunk_group_inner_get_chunk_group)(
846
- parent,
847
- this.#innerCompilation
848
- );
849
- return _ChunkGroup.__from_binding(cg, this.#innerCompilation);
850
- });
851
- }
852
- isInitial() {
853
- return this.#inner.isInitial;
854
- }
855
- get chunks() {
856
- return this.#inner.chunks.map(
857
- (c) => Chunk.__from_binding(c, this.#innerCompilation)
858
- );
859
- }
860
- get index() {
861
- return this.#inner.index;
862
- }
863
- get name() {
864
- return this.#inner.name;
865
- }
866
- get origins() {
867
- return this.#inner.origins;
868
- }
869
- /**
870
- * Note: This is not a webpack public API, maybe removed in future.
871
- *
872
- * @internal
873
- */
874
- __internal__innerUkey() {
875
- return this.#inner.__inner_ukey;
876
- }
877
- /**
878
- * Note: This is not a webpack public API, maybe removed in future.
879
- *
880
- * @internal
881
- */
882
- __internal__innerCompilation() {
883
- return this.#innerCompilation;
884
- }
885
- };
886
-
887
- // src/util/comparators.ts
888
- var TwoKeyWeakMap = class {
889
- constructor() {
890
- this._map = /* @__PURE__ */ new WeakMap();
891
- }
892
- get(key1, key2) {
893
- const childMap = this._map.get(key1);
894
- if (childMap === void 0) {
895
- return void 0;
896
- }
897
- return childMap.get(key2);
898
- }
899
- set(key1, key2, value) {
900
- let childMap = this._map.get(key1);
901
- if (childMap === void 0) {
902
- childMap = /* @__PURE__ */ new WeakMap();
903
- this._map.set(key1, childMap);
904
- }
905
- childMap.set(key2, value);
906
- }
907
- };
908
- var concatComparatorsCache = new TwoKeyWeakMap();
909
- var concatComparators = (...comps) => {
910
- const [c1, c2, ...cRest] = comps;
911
- if (c2 === void 0) {
912
- return c1;
913
- }
914
- if (cRest.length > 0) {
915
- const [c3, ...cRest2] = cRest;
916
- return concatComparators(c1, concatComparators(c2, c3, ...cRest2));
917
- }
918
- const cacheEntry = concatComparatorsCache.get(c1, c2);
919
- if (cacheEntry !== void 0) return cacheEntry;
920
- const result2 = (a, b) => {
921
- const res = c1(a, b);
922
- if (res !== 0) return res;
923
- return c2(a, b);
924
- };
925
- concatComparatorsCache.set(c1, c2, result2);
926
- return result2;
927
- };
928
- var compareIds = (a, b) => {
929
- if (typeof a !== typeof b) {
930
- return typeof a < typeof b ? -1 : 1;
931
- }
932
- if (a < b) return -1;
933
- if (a > b) return 1;
934
- return 0;
935
- };
936
- var compareChunkGroupsByIndex = (a, b) => {
937
- return a.index < b.index ? -1 : 1;
938
- };
939
- var compareSelectCache = new TwoKeyWeakMap();
940
- var compareSelect = (getter2, comparator) => {
941
- const cacheEntry = compareSelectCache.get(getter2, comparator);
942
- if (cacheEntry !== void 0) return cacheEntry;
943
- const result2 = (a, b) => {
944
- const aValue = getter2(a);
945
- const bValue = getter2(b);
946
- if (aValue !== void 0 && aValue !== null) {
947
- if (bValue !== void 0 && bValue !== null) {
948
- return comparator(aValue, bValue);
949
- }
950
- return -1;
951
- }
952
- if (bValue !== void 0 && bValue !== null) {
953
- return 1;
954
- }
955
- return 0;
956
- };
957
- compareSelectCache.set(getter2, comparator, result2);
958
- return result2;
959
- };
960
- var compareNumbers = (a, b) => {
961
- if (typeof a !== typeof b) {
962
- return typeof a < typeof b ? -1 : 1;
963
- }
964
- if (a < b) return -1;
965
- if (a > b) return 1;
966
- return 0;
967
- };
968
-
969
- // src/Chunk.ts
970
- var Chunk = class _Chunk {
971
- #inner;
972
- #innerCompilation;
973
- static __from_binding(chunk, compilation) {
974
- if (compilation instanceof Compilation) {
975
- return new _Chunk(chunk, compilation.__internal_getInner());
976
- }
977
- return new _Chunk(chunk, compilation);
978
- }
979
- constructor(chunk, compilation) {
980
- this.#inner = chunk;
981
- this.#innerCompilation = compilation;
982
- this.name = chunk.name;
983
- this.id = chunk.id;
984
- this.ids = chunk.ids;
985
- this.idNameHints = chunk.idNameHints;
986
- this.filenameTemplate = chunk.filenameTemplate;
987
- this.cssFilenameTemplate = chunk.cssFilenameTemplate;
988
- this.files = new Set(chunk.files);
989
- this.runtime = new Set(chunk.runtime);
990
- this.hash = chunk.hash;
991
- this.contentHash = chunk.contentHash;
992
- this.renderedHash = chunk.renderedHash;
993
- this.chunkReason = chunk.chunkReason;
994
- this.auxiliaryFiles = new Set(chunk.auxiliaryFiles);
995
- }
996
- isOnlyInitial() {
997
- return (0, import_binding2.__chunk_inner_is_only_initial)(
998
- this.#inner.__inner_ukey,
999
- this.#innerCompilation
1000
- );
1001
- }
1002
- canBeInitial() {
1003
- return (0, import_binding2.__chunk_inner_can_be_initial)(
1004
- this.#inner.__inner_ukey,
1005
- this.#innerCompilation
1006
- );
1007
- }
1008
- hasRuntime() {
1009
- return (0, import_binding2.__chunk_inner_has_runtime)(
1010
- this.#inner.__inner_ukey,
1011
- this.#innerCompilation
1012
- );
1013
- }
1014
- get groupsIterable() {
1015
- const chunk_groups = this.#inner.__inner_groups.map((ukey) => {
1016
- const cg = (0, import_binding2.__chunk_group_inner_get_chunk_group)(
1017
- ukey,
1018
- this.#innerCompilation
1019
- );
1020
- return ChunkGroup.__from_binding(cg, this.#innerCompilation);
1021
- });
1022
- chunk_groups.sort(compareChunkGroupsByIndex);
1023
- return new Set(chunk_groups);
1024
- }
1025
- getChunkMaps(realHash) {
1026
- const chunkHashMap = {};
1027
- const chunkContentHashMap = {};
1028
- const chunkNameMap = {};
1029
- for (const chunk of this.getAllAsyncChunks()) {
1030
- const id = chunk.id;
1031
- if (!id) continue;
1032
- const chunkHash = realHash ? chunk.hash : chunk.renderedHash;
1033
- if (chunkHash) {
1034
- chunkHashMap[id] = chunkHash;
1035
- }
1036
- for (const key of Object.keys(chunk.contentHash)) {
1037
- if (!chunkContentHashMap[key]) {
1038
- chunkContentHashMap[key] = {};
1039
- }
1040
- chunkContentHashMap[key][id] = chunk.contentHash[key];
1041
- }
1042
- if (chunk.name) {
1043
- chunkNameMap[id] = chunk.name;
1044
- }
1045
- }
1046
- return {
1047
- hash: chunkHashMap,
1048
- contentHash: chunkContentHashMap,
1049
- name: chunkNameMap
1050
- };
1051
- }
1052
- getAllAsyncChunks() {
1053
- return new Set(
1054
- (0, import_binding2.__chunk_inner_get_all_async_chunks)(
1055
- this.#inner.__inner_ukey,
1056
- this.#innerCompilation
1057
- ).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
1058
- );
1059
- }
1060
- getAllInitialChunks() {
1061
- return new Set(
1062
- (0, import_binding2.__chunk_inner_get_all_initial_chunks)(
1063
- this.#inner.__inner_ukey,
1064
- this.#innerCompilation
1065
- ).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
1066
- );
1067
- }
1068
- getAllReferencedChunks() {
1069
- return new Set(
1070
- (0, import_binding2.__chunk_inner_get_all_referenced_chunks)(
1071
- this.#inner.__inner_ukey,
1072
- this.#innerCompilation
1073
- ).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
1074
- );
1075
- }
1076
- /**
1077
- * Note: This is not a webpack public API, maybe removed in future.
1078
- *
1079
- * @internal
1080
- */
1081
- __internal__innerUkey() {
1082
- return this.#inner.__inner_ukey;
1083
- }
1084
- };
1085
-
1086
- // src/ChunkGraph.ts
1087
- var import_binding4 = require("@rspack/binding");
1088
-
1089
- // src/Module.ts
1090
- var import_binding3 = require("@rspack/binding");
819
+ var liteTapable = __toESM(require("@rspack/lite-tapable"));
1091
820
 
1092
821
  // src/Dependency.ts
1093
822
  var Dependency = class _Dependency {
@@ -1164,7 +893,7 @@ var DependenciesBlock = class _DependenciesBlock {
1164
893
  var import_webpack_sources = require("../compiled/webpack-sources/index.js");
1165
894
  var JsSource = class extends import_webpack_sources.Source {
1166
895
  static __from_binding(source) {
1167
- if (source.source instanceof Buffer) {
896
+ if (Buffer.isBuffer(source.source)) {
1168
897
  return new import_webpack_sources.RawSource(source.source);
1169
898
  }
1170
899
  if (!source.map) {
@@ -1324,20 +1053,22 @@ var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResol
1324
1053
  var MODULE_MAPPINGS = /* @__PURE__ */ new WeakMap();
1325
1054
  var Module = class _Module {
1326
1055
  #inner;
1327
- static __from_binding(binding3, compilation) {
1056
+ static __from_binding(binding3) {
1328
1057
  let module2 = MODULE_MAPPINGS.get(binding3);
1329
1058
  if (module2) {
1330
1059
  return module2;
1331
1060
  }
1332
- module2 = new _Module(binding3, compilation);
1061
+ module2 = new _Module(binding3);
1333
1062
  MODULE_MAPPINGS.set(binding3, module2);
1334
1063
  return module2;
1335
1064
  }
1336
1065
  static __to_binding(module2) {
1337
1066
  return module2.#inner;
1338
1067
  }
1339
- constructor(module2, compilation) {
1068
+ constructor(module2) {
1340
1069
  this.#inner = module2;
1070
+ this.buildInfo = {};
1071
+ this.buildMeta = {};
1341
1072
  Object.defineProperties(this, {
1342
1073
  type: {
1343
1074
  enumerable: true,
@@ -1393,152 +1124,334 @@ var Module = class _Module {
1393
1124
  modules: {
1394
1125
  enumerable: true,
1395
1126
  get() {
1396
- if (module2 instanceof import_binding3.JsModule) {
1397
- return module2.modules ? module2.modules.map((m) => _Module.__from_binding(m)) : void 0;
1398
- }
1399
- return void 0;
1127
+ return module2.modules ? module2.modules.map((m) => _Module.__from_binding(m)) : void 0;
1400
1128
  }
1401
1129
  },
1402
- buildInfo: {
1130
+ blocks: {
1403
1131
  enumerable: true,
1404
1132
  get() {
1405
- const customModule = compilation == null ? void 0 : compilation.__internal__getCustomModule(
1406
- module2.moduleIdentifier
1407
- );
1408
- return (customModule == null ? void 0 : customModule.buildInfo) || {};
1133
+ return module2.blocks.map((b) => DependenciesBlock.__from_binding(b));
1409
1134
  }
1410
1135
  },
1411
- buildMeta: {
1136
+ dependencies: {
1412
1137
  enumerable: true,
1413
1138
  get() {
1414
- const customModule = compilation == null ? void 0 : compilation.__internal__getCustomModule(
1415
- module2.moduleIdentifier
1416
- );
1417
- return (customModule == null ? void 0 : customModule.buildMeta) || {};
1139
+ return module2.dependencies.map((d) => Dependency.__from_binding(d));
1418
1140
  }
1419
1141
  },
1420
- blocks: {
1142
+ useSourceMap: {
1421
1143
  enumerable: true,
1422
1144
  get() {
1423
- if ("blocks" in module2) {
1424
- return module2.blocks.map((b) => DependenciesBlock.__from_binding(b));
1425
- }
1426
- return [];
1145
+ return module2.useSourceMap;
1146
+ }
1147
+ }
1148
+ });
1149
+ }
1150
+ originalSource() {
1151
+ if (this.#inner.originalSource) {
1152
+ return JsSource.__from_binding(this.#inner.originalSource);
1153
+ }
1154
+ return null;
1155
+ }
1156
+ identifier() {
1157
+ return this.#inner.moduleIdentifier;
1158
+ }
1159
+ nameForCondition() {
1160
+ if (typeof this.#inner.nameForCondition === "string") {
1161
+ return this.#inner.nameForCondition;
1162
+ }
1163
+ return null;
1164
+ }
1165
+ size(type) {
1166
+ if ("size" in this.#inner) {
1167
+ return this.#inner.size(type);
1168
+ }
1169
+ return 0;
1170
+ }
1171
+ };
1172
+ var CodeGenerationResult = class {
1173
+ #inner;
1174
+ constructor(result2) {
1175
+ this.#inner = result2;
1176
+ }
1177
+ get(sourceType) {
1178
+ return this.#inner.sources[sourceType];
1179
+ }
1180
+ };
1181
+
1182
+ // src/ChunkGroup.ts
1183
+ var CHUNK_GROUP_MAPPINGS = /* @__PURE__ */ new WeakMap();
1184
+ var ChunkGroup = class _ChunkGroup {
1185
+ #inner;
1186
+ static __from_binding(binding3) {
1187
+ let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding3);
1188
+ if (chunkGroup) {
1189
+ return chunkGroup;
1190
+ }
1191
+ chunkGroup = new _ChunkGroup(binding3);
1192
+ CHUNK_GROUP_MAPPINGS.set(binding3, chunkGroup);
1193
+ return chunkGroup;
1194
+ }
1195
+ constructor(inner) {
1196
+ this.#inner = inner;
1197
+ Object.defineProperties(this, {
1198
+ chunks: {
1199
+ enumerable: true,
1200
+ get: () => {
1201
+ return this.#inner.chunks.map(
1202
+ (binding3) => Chunk.__from_binding(binding3)
1203
+ );
1427
1204
  }
1428
1205
  },
1429
- dependencies: {
1206
+ index: {
1430
1207
  enumerable: true,
1431
- get() {
1432
- if ("dependencies" in module2) {
1433
- return module2.dependencies.map((d) => Dependency.__from_binding(d));
1434
- }
1435
- return [];
1208
+ get: () => {
1209
+ return this.#inner.index;
1436
1210
  }
1437
1211
  },
1438
- useSourceMap: {
1212
+ name: {
1439
1213
  enumerable: true,
1440
- get() {
1441
- return module2.useSourceMap;
1214
+ get: () => {
1215
+ return this.#inner.name;
1216
+ }
1217
+ },
1218
+ origins: {
1219
+ enumerable: true,
1220
+ get: () => {
1221
+ return this.#inner.origins.map((origin) => ({
1222
+ module: origin.module ? Module.__from_binding(origin.module) : void 0,
1223
+ request: origin.request
1224
+ }));
1225
+ }
1226
+ }
1227
+ });
1228
+ }
1229
+ getFiles() {
1230
+ return this.#inner.getFiles();
1231
+ }
1232
+ getParents() {
1233
+ return this.#inner.getParents().map((binding3) => _ChunkGroup.__from_binding(binding3));
1234
+ }
1235
+ isInitial() {
1236
+ return this.#inner.isInitial();
1237
+ }
1238
+ };
1239
+
1240
+ // src/Chunk.ts
1241
+ var CHUNK_MAPPINGS = /* @__PURE__ */ new WeakMap();
1242
+ var Chunk = class _Chunk {
1243
+ #inner;
1244
+ static __from_binding(binding3) {
1245
+ let chunk = CHUNK_MAPPINGS.get(binding3);
1246
+ if (chunk) {
1247
+ return chunk;
1248
+ }
1249
+ chunk = new _Chunk(binding3);
1250
+ CHUNK_MAPPINGS.set(binding3, chunk);
1251
+ return chunk;
1252
+ }
1253
+ static __to_binding(chunk) {
1254
+ return chunk.#inner;
1255
+ }
1256
+ constructor(binding3) {
1257
+ this.#inner = binding3;
1258
+ Object.defineProperties(this, {
1259
+ name: {
1260
+ enumerable: true,
1261
+ get: () => {
1262
+ return binding3.name;
1263
+ }
1264
+ },
1265
+ id: {
1266
+ enumerable: true,
1267
+ get: () => {
1268
+ return binding3.id;
1269
+ }
1270
+ },
1271
+ ids: {
1272
+ enumerable: true,
1273
+ get: () => {
1274
+ return binding3.ids;
1275
+ }
1276
+ },
1277
+ idNameHints: {
1278
+ enumerable: true,
1279
+ get: () => {
1280
+ return binding3.idNameHints;
1281
+ }
1282
+ },
1283
+ filenameTemplate: {
1284
+ enumerable: true,
1285
+ get: () => {
1286
+ return binding3.filenameTemplate;
1287
+ }
1288
+ },
1289
+ cssFilenameTemplate: {
1290
+ enumerable: true,
1291
+ get: () => {
1292
+ return binding3.cssFilenameTemplate;
1293
+ }
1294
+ },
1295
+ files: {
1296
+ enumerable: true,
1297
+ get: () => {
1298
+ return new Set(binding3.files);
1299
+ }
1300
+ },
1301
+ runtime: {
1302
+ enumerable: true,
1303
+ get: () => {
1304
+ return new Set(binding3.runtime);
1305
+ }
1306
+ },
1307
+ hash: {
1308
+ enumerable: true,
1309
+ get: () => {
1310
+ return binding3.hash;
1442
1311
  }
1312
+ },
1313
+ contentHash: {
1314
+ enumerable: true,
1315
+ get: () => {
1316
+ return binding3.contentHash;
1317
+ }
1318
+ },
1319
+ renderedHash: {
1320
+ enumerable: true,
1321
+ get: () => {
1322
+ return binding3.renderedHash;
1323
+ }
1324
+ },
1325
+ chunkReason: {
1326
+ enumerable: true,
1327
+ get: () => {
1328
+ return binding3.chunkReason;
1329
+ }
1330
+ },
1331
+ auxiliaryFiles: {
1332
+ enumerable: true,
1333
+ get: () => {
1334
+ return new Set(binding3.auxiliaryFiles);
1335
+ }
1336
+ }
1337
+ });
1338
+ }
1339
+ isOnlyInitial() {
1340
+ return this.#inner.isOnlyInitial();
1341
+ }
1342
+ canBeInitial() {
1343
+ return this.#inner.canBeInitial();
1344
+ }
1345
+ hasRuntime() {
1346
+ return this.#inner.hasRuntime();
1347
+ }
1348
+ get groupsIterable() {
1349
+ return new Set(
1350
+ this.#inner.groups().map((binding3) => ChunkGroup.__from_binding(binding3))
1351
+ );
1352
+ }
1353
+ getChunkMaps(realHash) {
1354
+ const chunkHashMap = {};
1355
+ const chunkContentHashMap = {};
1356
+ const chunkNameMap = {};
1357
+ for (const chunk of this.getAllAsyncChunks()) {
1358
+ const id = chunk.id;
1359
+ if (!id) continue;
1360
+ const chunkHash = realHash ? chunk.hash : chunk.renderedHash;
1361
+ if (chunkHash) {
1362
+ chunkHashMap[id] = chunkHash;
1363
+ }
1364
+ for (const key of Object.keys(chunk.contentHash)) {
1365
+ if (!chunkContentHashMap[key]) {
1366
+ chunkContentHashMap[key] = {};
1367
+ }
1368
+ chunkContentHashMap[key][id] = chunk.contentHash[key];
1369
+ }
1370
+ if (chunk.name) {
1371
+ chunkNameMap[id] = chunk.name;
1443
1372
  }
1444
- });
1445
- }
1446
- originalSource() {
1447
- if (this.#inner.originalSource) {
1448
- return JsSource.__from_binding(this.#inner.originalSource);
1449
- }
1450
- return null;
1451
- }
1452
- identifier() {
1453
- return this.#inner.moduleIdentifier;
1454
- }
1455
- nameForCondition() {
1456
- if (typeof this.#inner.nameForCondition === "string") {
1457
- return this.#inner.nameForCondition;
1458
1373
  }
1459
- return null;
1374
+ return {
1375
+ hash: chunkHashMap,
1376
+ contentHash: chunkContentHashMap,
1377
+ name: chunkNameMap
1378
+ };
1460
1379
  }
1461
- size(type) {
1462
- if ("size" in this.#inner) {
1463
- return this.#inner.size(type);
1464
- }
1465
- return 0;
1380
+ getAllAsyncChunks() {
1381
+ return new Set(
1382
+ this.#inner.getAllAsyncChunks().map((binding3) => _Chunk.__from_binding(binding3))
1383
+ );
1466
1384
  }
1467
- };
1468
- var CodeGenerationResult = class {
1469
- #inner;
1470
- constructor(result2) {
1471
- this.#inner = result2;
1385
+ getAllInitialChunks() {
1386
+ return new Set(
1387
+ this.#inner.getAllInitialChunks().map((binding3) => _Chunk.__from_binding(binding3))
1388
+ );
1472
1389
  }
1473
- get(sourceType) {
1474
- return this.#inner.sources[sourceType];
1390
+ getAllReferencedChunks() {
1391
+ return new Set(
1392
+ this.#inner.getAllReferencedChunks().map((binding3) => _Chunk.__from_binding(binding3))
1393
+ );
1475
1394
  }
1476
1395
  };
1477
1396
 
1478
1397
  // src/ChunkGraph.ts
1479
- var ChunkGraph = class {
1480
- constructor(compilation) {
1481
- this.compilation = compilation;
1398
+ var ChunkGraph = class _ChunkGraph {
1399
+ #inner;
1400
+ static __from_binding(binding3) {
1401
+ return new _ChunkGraph(binding3);
1402
+ }
1403
+ constructor(binding3) {
1404
+ this.#inner = binding3;
1482
1405
  }
1483
1406
  getChunkModules(chunk) {
1484
- return (0, import_binding4.__chunk_graph_inner_get_chunk_modules)(
1485
- chunk.__internal__innerUkey(),
1486
- this.compilation.__internal_getInner()
1487
- ).map((m) => Module.__from_binding(m, this.compilation));
1407
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1488
1408
  }
1489
1409
  getChunkModulesIterable(chunk) {
1490
- return new Set(
1491
- (0, import_binding4.__chunk_graph_inner_get_chunk_modules)(
1492
- chunk.__internal__innerUkey(),
1493
- this.compilation.__internal_getInner()
1494
- ).map((m) => Module.__from_binding(m, this.compilation))
1495
- );
1410
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1496
1411
  }
1497
1412
  getChunkEntryModulesIterable(chunk) {
1498
- return new Set(
1499
- (0, import_binding4.__chunk_graph_inner_get_chunk_entry_modules)(
1500
- chunk.__internal__innerUkey(),
1501
- this.compilation.__internal_getInner()
1502
- ).map((m) => Module.__from_binding(m, this.compilation))
1503
- );
1413
+ return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1504
1414
  }
1505
1415
  getChunkEntryDependentChunksIterable(chunk) {
1506
- return new Set(
1507
- (0, import_binding4.__chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable)(
1508
- chunk.__internal__innerUkey(),
1509
- this.compilation.__internal_getInner()
1510
- ).map(
1511
- (c) => Chunk.__from_binding(c, this.compilation.__internal_getInner())
1512
- )
1513
- );
1416
+ return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding3) => Chunk.__from_binding(binding3));
1514
1417
  }
1515
1418
  getChunkModulesIterableBySourceType(chunk, sourceType) {
1516
- return new Set(
1517
- (0, import_binding4.__chunk_graph_inner_get_chunk_modules_iterable_by_source_type)(
1518
- chunk.__internal__innerUkey(),
1519
- sourceType,
1520
- this.compilation.__internal_getInner()
1521
- ).map((m) => Module.__from_binding(m, this.compilation))
1522
- );
1419
+ return this.#inner.getChunkModulesIterableBySourceType(
1420
+ Chunk.__to_binding(chunk),
1421
+ sourceType
1422
+ ).map((binding3) => Module.__from_binding(binding3));
1423
+ }
1424
+ getModuleChunks(module2) {
1425
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1426
+ }
1427
+ getModuleChunksIterable(module2) {
1428
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1429
+ }
1430
+ getModuleId(module2) {
1431
+ return this.#inner.getModuleId(Module.__to_binding(module2));
1523
1432
  }
1524
1433
  };
1525
1434
 
1526
1435
  // src/Entrypoint.ts
1527
- var import_binding5 = require("@rspack/binding");
1436
+ var ENTRYPOINT_MAPPINGS = /* @__PURE__ */ new WeakMap();
1528
1437
  var Entrypoint = class _Entrypoint extends ChunkGroup {
1529
- static __from_binding(chunk, compilation) {
1530
- return new _Entrypoint(chunk, compilation);
1438
+ #inner;
1439
+ static __from_binding(binding3) {
1440
+ let entrypoint = ENTRYPOINT_MAPPINGS.get(binding3);
1441
+ if (entrypoint) {
1442
+ return entrypoint;
1443
+ }
1444
+ entrypoint = new _Entrypoint(binding3);
1445
+ ENTRYPOINT_MAPPINGS.set(binding3, entrypoint);
1446
+ return entrypoint;
1531
1447
  }
1532
- constructor(inner, compilation) {
1533
- super(inner, compilation);
1448
+ constructor(binding3) {
1449
+ super(binding3);
1450
+ this.#inner = binding3;
1534
1451
  }
1535
1452
  getRuntimeChunk() {
1536
- const c = (0, import_binding5.__entrypoint_inner_get_runtime_chunk)(
1537
- this.__internal__innerUkey(),
1538
- this.__internal__innerCompilation()
1539
- );
1540
- if (c) return Chunk.__from_binding(c, this.__internal__innerCompilation());
1541
- return null;
1453
+ const chunkBinding = this.#inner.getRuntimeChunk();
1454
+ return chunkBinding ? Chunk.__from_binding(chunkBinding) : null;
1542
1455
  }
1543
1456
  };
1544
1457
 
@@ -1555,6 +1468,64 @@ var cutOffByFlag = (stack, flag) => {
1555
1468
  };
1556
1469
  var cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
1557
1470
 
1471
+ // src/ExportsInfo.ts
1472
+ var ExportsInfo = class _ExportsInfo {
1473
+ #inner;
1474
+ static __from_binding(binding3) {
1475
+ return new _ExportsInfo(binding3);
1476
+ }
1477
+ constructor(binding3) {
1478
+ this.#inner = binding3;
1479
+ }
1480
+ isUsed(runtime) {
1481
+ return this.#inner.isUsed(runtime);
1482
+ }
1483
+ isModuleUsed(runtime) {
1484
+ return this.#inner.isModuleUsed(runtime);
1485
+ }
1486
+ setUsedInUnknownWay(runtime) {
1487
+ return this.#inner.setUsedInUnknownWay(runtime);
1488
+ }
1489
+ getUsed(name2, runtime) {
1490
+ return this.#inner.getUsed(name2, runtime);
1491
+ }
1492
+ };
1493
+
1494
+ // src/ModuleGraphConnection.ts
1495
+ var MODULE_GRAPH_CONNECTION_MAPPINGS = /* @__PURE__ */ new WeakMap();
1496
+ var ModuleGraphConnection = class _ModuleGraphConnection {
1497
+ #inner;
1498
+ static __from_binding(binding3) {
1499
+ let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding3);
1500
+ if (connection) {
1501
+ return connection;
1502
+ }
1503
+ connection = new _ModuleGraphConnection(binding3);
1504
+ MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding3, connection);
1505
+ return connection;
1506
+ }
1507
+ static __to_binding(data) {
1508
+ return data.#inner;
1509
+ }
1510
+ constructor(binding3) {
1511
+ this.#inner = binding3;
1512
+ Object.defineProperties(this, {
1513
+ module: {
1514
+ enumerable: true,
1515
+ get() {
1516
+ return binding3.module ? Module.__from_binding(binding3.module) : null;
1517
+ }
1518
+ },
1519
+ dependency: {
1520
+ enumerable: true,
1521
+ get() {
1522
+ return Dependency.__from_binding(binding3.dependency);
1523
+ }
1524
+ }
1525
+ });
1526
+ }
1527
+ };
1528
+
1558
1529
  // src/ModuleGraph.ts
1559
1530
  var ModuleGraph = class _ModuleGraph {
1560
1531
  static __from_binding(binding3) {
@@ -1568,10 +1539,30 @@ var ModuleGraph = class _ModuleGraph {
1568
1539
  const binding3 = this.#inner.getModule(Dependency.__to_binding(dependency));
1569
1540
  return binding3 ? Module.__from_binding(binding3) : null;
1570
1541
  }
1542
+ getResolvedModule(dependency) {
1543
+ const binding3 = this.#inner.getResolvedModule(
1544
+ Dependency.__to_binding(dependency)
1545
+ );
1546
+ return binding3 ? Module.__from_binding(binding3) : null;
1547
+ }
1571
1548
  getIssuer(module2) {
1572
1549
  const binding3 = this.#inner.getIssuer(Module.__to_binding(module2));
1573
1550
  return binding3 ? Module.__from_binding(binding3) : null;
1574
1551
  }
1552
+ getExportsInfo(module2) {
1553
+ return ExportsInfo.__from_binding(
1554
+ this.#inner.getExportsInfo(Module.__to_binding(module2))
1555
+ );
1556
+ }
1557
+ getConnection(dependency) {
1558
+ const binding3 = this.#inner.getConnection(
1559
+ Dependency.__to_binding(dependency)
1560
+ );
1561
+ return binding3 ? ModuleGraphConnection.__from_binding(binding3) : null;
1562
+ }
1563
+ getOutgoingConnections(module2) {
1564
+ return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding3) => ModuleGraphConnection.__from_binding(binding3));
1565
+ }
1575
1566
  };
1576
1567
 
1577
1568
  // src/util/index.ts
@@ -1859,6 +1850,16 @@ function presetToOptions(name2) {
1859
1850
  }
1860
1851
  }
1861
1852
 
1853
+ // src/lib/WebpackError.ts
1854
+ var import_node_util = require("util");
1855
+ var WebpackError = class extends Error {
1856
+ [import_node_util.inspect.custom]() {
1857
+ return this.stack + (this.details ? `
1858
+ ${this.details}` : "");
1859
+ }
1860
+ };
1861
+ var WebpackError_default = WebpackError;
1862
+
1862
1863
  // src/logging/Logger.ts
1863
1864
  var LogType = Object.freeze({
1864
1865
  error: (
@@ -2054,6 +2055,85 @@ var Logger = class {
2054
2055
  // src/stats/StatsFactory.ts
2055
2056
  var import_lite_tapable = require("@rspack/lite-tapable");
2056
2057
 
2058
+ // src/util/comparators.ts
2059
+ var TwoKeyWeakMap = class {
2060
+ constructor() {
2061
+ this._map = /* @__PURE__ */ new WeakMap();
2062
+ }
2063
+ get(key1, key2) {
2064
+ const childMap = this._map.get(key1);
2065
+ if (childMap === void 0) {
2066
+ return void 0;
2067
+ }
2068
+ return childMap.get(key2);
2069
+ }
2070
+ set(key1, key2, value) {
2071
+ let childMap = this._map.get(key1);
2072
+ if (childMap === void 0) {
2073
+ childMap = /* @__PURE__ */ new WeakMap();
2074
+ this._map.set(key1, childMap);
2075
+ }
2076
+ childMap.set(key2, value);
2077
+ }
2078
+ };
2079
+ var concatComparatorsCache = new TwoKeyWeakMap();
2080
+ var concatComparators = (...comps) => {
2081
+ const [c1, c2, ...cRest] = comps;
2082
+ if (c2 === void 0) {
2083
+ return c1;
2084
+ }
2085
+ if (cRest.length > 0) {
2086
+ const [c3, ...cRest2] = cRest;
2087
+ return concatComparators(c1, concatComparators(c2, c3, ...cRest2));
2088
+ }
2089
+ const cacheEntry = concatComparatorsCache.get(c1, c2);
2090
+ if (cacheEntry !== void 0) return cacheEntry;
2091
+ const result2 = (a, b) => {
2092
+ const res = c1(a, b);
2093
+ if (res !== 0) return res;
2094
+ return c2(a, b);
2095
+ };
2096
+ concatComparatorsCache.set(c1, c2, result2);
2097
+ return result2;
2098
+ };
2099
+ var compareIds = (a, b) => {
2100
+ if (typeof a !== typeof b) {
2101
+ return typeof a < typeof b ? -1 : 1;
2102
+ }
2103
+ if (a < b) return -1;
2104
+ if (a > b) return 1;
2105
+ return 0;
2106
+ };
2107
+ var compareSelectCache = new TwoKeyWeakMap();
2108
+ var compareSelect = (getter2, comparator) => {
2109
+ const cacheEntry = compareSelectCache.get(getter2, comparator);
2110
+ if (cacheEntry !== void 0) return cacheEntry;
2111
+ const result2 = (a, b) => {
2112
+ const aValue = getter2(a);
2113
+ const bValue = getter2(b);
2114
+ if (aValue !== void 0 && aValue !== null) {
2115
+ if (bValue !== void 0 && bValue !== null) {
2116
+ return comparator(aValue, bValue);
2117
+ }
2118
+ return -1;
2119
+ }
2120
+ if (bValue !== void 0 && bValue !== null) {
2121
+ return 1;
2122
+ }
2123
+ return 0;
2124
+ };
2125
+ compareSelectCache.set(getter2, comparator, result2);
2126
+ return result2;
2127
+ };
2128
+ var compareNumbers = (a, b) => {
2129
+ if (typeof a !== typeof b) {
2130
+ return typeof a < typeof b ? -1 : 1;
2131
+ }
2132
+ if (a < b) return -1;
2133
+ if (a > b) return 1;
2134
+ return 0;
2135
+ };
2136
+
2057
2137
  // src/util/smartGrouping.ts
2058
2138
  var smartGrouping = (items, groupConfigs) => {
2059
2139
  const itemsWithGroups = /* @__PURE__ */ new Set();
@@ -2792,7 +2872,7 @@ function memoizeValue(fn2) {
2792
2872
  }
2793
2873
 
2794
2874
  // src/Compilation.ts
2795
- var _inner, _shutdown, _customModules, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
2875
+ var _inner, _shutdown, _addIncludeDispatcher, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
2796
2876
  var _Compilation = class _Compilation {
2797
2877
  constructor(compiler, inner) {
2798
2878
  __privateAdd(this, _Compilation_instances);
@@ -2803,11 +2883,7 @@ var _Compilation = class _Compilation {
2803
2883
  return null;
2804
2884
  }
2805
2885
  };
2806
- /**
2807
- * Records the dynamically added fields for Module on the JavaScript side, using the Module identifier for association.
2808
- * These fields are generally used within a plugin, so they do not need to be passed back to the Rust side.
2809
- */
2810
- __privateAdd(this, _customModules);
2886
+ __privateAdd(this, _addIncludeDispatcher);
2811
2887
  this.fileDependencies = createFakeCompilationDependencies(
2812
2888
  () => __privateGet(this, _inner).dependencies().fileDependencies,
2813
2889
  (d) => __privateGet(this, _inner).addFileDependencies(d)
@@ -2832,7 +2908,7 @@ var _Compilation = class _Compilation {
2832
2908
  for (const [id, callback] of args) {
2833
2909
  const m = modules.find((item) => item.moduleIdentifier === id);
2834
2910
  if (m) {
2835
- callback(err, Module.__from_binding(m, compilation));
2911
+ callback(err, Module.__from_binding(m));
2836
2912
  } else {
2837
2913
  callback(err || new Error("module no found"), null);
2838
2914
  }
@@ -2843,7 +2919,6 @@ var _Compilation = class _Compilation {
2843
2919
  ))(this));
2844
2920
  __privateSet(this, _inner, inner);
2845
2921
  __privateSet(this, _shutdown, false);
2846
- __privateSet(this, _customModules, {});
2847
2922
  const processAssetsHook = new liteTapable.AsyncSeriesHook([
2848
2923
  "assets"
2849
2924
  ]);
@@ -2928,7 +3003,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2928
3003
  ),
2929
3004
  runtimeModule: new liteTapable.SyncHook(["module", "chunk"]),
2930
3005
  seal: new liteTapable.SyncHook([]),
2931
- afterSeal: new liteTapable.AsyncSeriesHook([])
3006
+ afterSeal: new liteTapable.AsyncSeriesHook([]),
3007
+ needAdditionalPass: new liteTapable.SyncBailHook([])
2932
3008
  };
2933
3009
  this.compiler = compiler;
2934
3010
  this.resolverFactory = compiler.resolverFactory;
@@ -2938,8 +3014,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2938
3014
  this.logging = /* @__PURE__ */ new Map();
2939
3015
  this.childrenCounters = {};
2940
3016
  this.children = [];
2941
- this.chunkGraph = new ChunkGraph(this);
3017
+ this.needAdditionalPass = false;
3018
+ this.chunkGraph = ChunkGraph.__from_binding(inner.chunkGraph);
2942
3019
  this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph);
3020
+ __privateSet(this, _addIncludeDispatcher, new AddIncludeDispatcher(
3021
+ inner.addInclude.bind(inner)
3022
+ ));
2943
3023
  }
2944
3024
  get hash() {
2945
3025
  return __privateGet(this, _inner).hash;
@@ -2961,16 +3041,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2961
3041
  () => new Map(
2962
3042
  Object.entries(__privateGet(this, _inner).entrypoints).map(([n, e]) => [
2963
3043
  n,
2964
- Entrypoint.__from_binding(e, __privateGet(this, _inner))
3044
+ Entrypoint.__from_binding(e)
2965
3045
  ])
2966
3046
  )
2967
3047
  );
2968
3048
  }
2969
3049
  get chunkGroups() {
2970
3050
  return memoizeValue(
2971
- () => __privateGet(this, _inner).chunkGroups.map(
2972
- (cg) => ChunkGroup.__from_binding(cg, __privateGet(this, _inner))
2973
- )
3051
+ () => __privateGet(this, _inner).chunkGroups.map((binding3) => ChunkGroup.__from_binding(binding3))
2974
3052
  );
2975
3053
  }
2976
3054
  /**
@@ -2986,22 +3064,20 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2986
3064
  },
2987
3065
  get: (property) => {
2988
3066
  if (typeof property === "string") {
2989
- const chunk = __privateGet(this, _inner).getNamedChunkGroup(property) || void 0;
2990
- return chunk && ChunkGroup.__from_binding(chunk, __privateGet(this, _inner));
3067
+ const binding3 = __privateGet(this, _inner).getNamedChunkGroup(property);
3068
+ return ChunkGroup.__from_binding(binding3);
2991
3069
  }
2992
3070
  }
2993
3071
  });
2994
3072
  }
2995
3073
  get modules() {
2996
3074
  return new Set(
2997
- __privateGet(this, _inner).modules.map((module2) => Module.__from_binding(module2, this))
3075
+ __privateGet(this, _inner).modules.map((module2) => Module.__from_binding(module2))
2998
3076
  );
2999
3077
  }
3000
3078
  get builtModules() {
3001
3079
  return new Set(
3002
- __privateGet(this, _inner).builtModules.map(
3003
- (module2) => Module.__from_binding(module2, this)
3004
- )
3080
+ __privateGet(this, _inner).builtModules.map((module2) => Module.__from_binding(module2))
3005
3081
  );
3006
3082
  }
3007
3083
  get chunks() {
@@ -3020,8 +3096,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3020
3096
  },
3021
3097
  get: (property) => {
3022
3098
  if (typeof property === "string") {
3023
- const chunk = __privateGet(this, _inner).getNamedChunk(property) || void 0;
3024
- return chunk && Chunk.__from_binding(chunk, __privateGet(this, _inner));
3099
+ const binding3 = __privateGet(this, _inner).getNamedChunk(property);
3100
+ return Chunk.__from_binding(binding3);
3025
3101
  }
3026
3102
  }
3027
3103
  });
@@ -3029,21 +3105,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3029
3105
  get entries() {
3030
3106
  return new Entries(__privateGet(this, _inner).entries);
3031
3107
  }
3032
- /**
3033
- * Note: This is not a webpack public API, maybe removed in future.
3034
- *
3035
- * @internal
3036
- */
3037
- __internal__getCustomModule(moduleIdentifier) {
3038
- let module2 = __privateGet(this, _customModules)[moduleIdentifier];
3039
- if (!module2) {
3040
- module2 = __privateGet(this, _customModules)[moduleIdentifier] = {
3041
- buildInfo: {},
3042
- buildMeta: {}
3043
- };
3044
- }
3045
- return module2;
3046
- }
3047
3108
  getCache(name2) {
3048
3109
  return this.compiler.getCache(name2);
3049
3110
  }
@@ -3194,7 +3255,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3194
3255
  for (let i = 0; i < errs.length; i++) {
3195
3256
  const error = errs[i];
3196
3257
  inner.pushDiagnostic(
3197
- JsRspackDiagnostic.__to_binding(error, import_binding6.JsRspackSeverity.Error)
3258
+ JsRspackDiagnostic.__to_binding(error, import_binding.JsRspackSeverity.Error)
3198
3259
  );
3199
3260
  }
3200
3261
  return Reflect.apply(target2, thisArg, errs);
@@ -3220,7 +3281,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3220
3281
  const errList = errs.map((error) => {
3221
3282
  return JsRspackDiagnostic.__to_binding(
3222
3283
  error,
3223
- import_binding6.JsRspackSeverity.Error
3284
+ import_binding.JsRspackSeverity.Error
3224
3285
  );
3225
3286
  });
3226
3287
  inner.spliceDiagnostic(0, 0, errList);
@@ -3233,7 +3294,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3233
3294
  const errList = errors2.map((error) => {
3234
3295
  return JsRspackDiagnostic.__to_binding(
3235
3296
  error,
3236
- import_binding6.JsRspackSeverity.Error
3297
+ import_binding.JsRspackSeverity.Error
3237
3298
  );
3238
3299
  });
3239
3300
  inner.spliceDiagnostic(startIdx, startIdx + delCount, errList);
@@ -3260,7 +3321,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3260
3321
  0,
3261
3322
  length,
3262
3323
  errors.map((error) => {
3263
- return JsRspackDiagnostic.__to_binding(error, import_binding6.JsRspackSeverity.Error);
3324
+ return JsRspackDiagnostic.__to_binding(error, import_binding.JsRspackSeverity.Error);
3264
3325
  })
3265
3326
  );
3266
3327
  }
@@ -3277,7 +3338,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3277
3338
  thisArg,
3278
3339
  processWarningsHook.call(warns).map((warn) => {
3279
3340
  inner.pushDiagnostic(
3280
- JsRspackDiagnostic.__to_binding(warn, import_binding6.JsRspackSeverity.Warn)
3341
+ JsRspackDiagnostic.__to_binding(warn, import_binding.JsRspackSeverity.Warn)
3281
3342
  );
3282
3343
  return warn;
3283
3344
  })
@@ -3308,7 +3369,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3308
3369
  warnings2.map((warn) => {
3309
3370
  return JsRspackDiagnostic.__to_binding(
3310
3371
  warn,
3311
- import_binding6.JsRspackSeverity.Warn
3372
+ import_binding.JsRspackSeverity.Warn
3312
3373
  );
3313
3374
  })
3314
3375
  );
@@ -3320,7 +3381,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3320
3381
  handler(target2, thisArg, [startIdx, delCount, ...warns]) {
3321
3382
  warns = processWarningsHook.call(warns);
3322
3383
  const warnList = warns.map((warn) => {
3323
- return JsRspackDiagnostic.__to_binding(warn, import_binding6.JsRspackSeverity.Warn);
3384
+ return JsRspackDiagnostic.__to_binding(warn, import_binding.JsRspackSeverity.Warn);
3324
3385
  });
3325
3386
  inner.spliceDiagnostic(startIdx, startIdx + delCount, warnList);
3326
3387
  return Reflect.apply(target2, thisArg, [
@@ -3346,7 +3407,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3346
3407
  0,
3347
3408
  length,
3348
3409
  warnings.map((warning) => {
3349
- return JsRspackDiagnostic.__to_binding(warning, import_binding6.JsRspackSeverity.Warn);
3410
+ return JsRspackDiagnostic.__to_binding(warning, import_binding.JsRspackSeverity.Warn);
3350
3411
  })
3351
3412
  );
3352
3413
  }
@@ -3506,10 +3567,13 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3506
3567
  addRuntimeModule(chunk, runtimeModule) {
3507
3568
  runtimeModule.attach(this, chunk, this.chunkGraph);
3508
3569
  __privateGet(this, _inner).addRuntimeModule(
3509
- chunk.__internal__innerUkey(),
3570
+ Chunk.__to_binding(chunk),
3510
3571
  RuntimeModule.__to_binding(this, runtimeModule)
3511
3572
  );
3512
3573
  }
3574
+ addInclude(context2, dependency, options, callback) {
3575
+ __privateGet(this, _addIncludeDispatcher).call(context2, dependency, options, callback);
3576
+ }
3513
3577
  /**
3514
3578
  * Get the `Source` of a given asset filename.
3515
3579
  *
@@ -3570,7 +3634,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3570
3634
  * @internal
3571
3635
  */
3572
3636
  __internal__getChunks() {
3573
- return __privateGet(this, _inner).getChunks().map((c) => Chunk.__from_binding(c, __privateGet(this, _inner)));
3637
+ return __privateGet(this, _inner).getChunks().map((binding3) => Chunk.__from_binding(binding3));
3574
3638
  }
3575
3639
  /**
3576
3640
  * Note: This is not a webpack public API, maybe removed in future.
@@ -3593,7 +3657,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3593
3657
  };
3594
3658
  _inner = new WeakMap();
3595
3659
  _shutdown = new WeakMap();
3596
- _customModules = new WeakMap();
3660
+ _addIncludeDispatcher = new WeakMap();
3597
3661
  _Compilation_instances = new WeakSet();
3598
3662
  createCachedAssets_fn = function() {
3599
3663
  return new Proxy(
@@ -3654,6 +3718,52 @@ _Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER = 3e3;
3654
3718
  _Compilation.PROCESS_ASSETS_STAGE_ANALYSE = 4e3;
3655
3719
  _Compilation.PROCESS_ASSETS_STAGE_REPORT = 5e3;
3656
3720
  var Compilation = _Compilation;
3721
+ var AddIncludeDispatcher = class {
3722
+ #inner;
3723
+ #running;
3724
+ #args = [];
3725
+ #cbs = [];
3726
+ #execute = () => {
3727
+ if (this.#running) {
3728
+ return;
3729
+ }
3730
+ const args = this.#args;
3731
+ this.#args = [];
3732
+ const cbs = this.#cbs;
3733
+ this.#cbs = [];
3734
+ this.#inner(args, (wholeErr, results) => {
3735
+ if (this.#args.length !== 0) {
3736
+ queueMicrotask(this.#execute);
3737
+ }
3738
+ if (wholeErr) {
3739
+ const webpackError = new WebpackError_default(wholeErr.message);
3740
+ for (const cb of cbs) {
3741
+ cb(webpackError);
3742
+ }
3743
+ return;
3744
+ }
3745
+ for (let i = 0; i < results.length; i++) {
3746
+ const [errMsg, moduleBinding] = results[i];
3747
+ const cb = cbs[i];
3748
+ cb(
3749
+ errMsg ? new WebpackError_default(errMsg) : null,
3750
+ Module.__from_binding(moduleBinding)
3751
+ );
3752
+ }
3753
+ });
3754
+ };
3755
+ constructor(binding3) {
3756
+ this.#inner = binding3;
3757
+ this.#running = false;
3758
+ }
3759
+ call(context2, dependency, options, callback) {
3760
+ if (this.#args.length === 0) {
3761
+ queueMicrotask(this.#execute);
3762
+ }
3763
+ this.#args.push([context2, dependency, options]);
3764
+ this.#cbs.push(callback);
3765
+ }
3766
+ };
3657
3767
  var EntryData = class _EntryData {
3658
3768
  static __from_binding(binding3) {
3659
3769
  return new _EntryData(binding3);
@@ -3789,16 +3899,6 @@ var ConcurrentCompilationError = class extends Error {
3789
3899
  // src/lib/Cache.ts
3790
3900
  var import_lite_tapable3 = require("@rspack/lite-tapable");
3791
3901
 
3792
- // src/lib/WebpackError.ts
3793
- var import_node_util = require("util");
3794
- var WebpackError = class extends Error {
3795
- [import_node_util.inspect.custom]() {
3796
- return this.stack + (this.details ? `
3797
- ${this.details}` : "");
3798
- }
3799
- };
3800
- var WebpackError_default = WebpackError;
3801
-
3802
3902
  // src/lib/HookWebpackError.ts
3803
3903
  var HookWebpackError = class extends WebpackError_default {
3804
3904
  /**
@@ -5142,40 +5242,40 @@ function create2(name2, resolve2, affectedHooks) {
5142
5242
  }
5143
5243
 
5144
5244
  // src/builtin-plugin/APIPlugin.ts
5145
- var import_binding7 = require("@rspack/binding");
5146
- var APIPlugin = create2(import_binding7.BuiltinPluginName.APIPlugin, () => {
5245
+ var import_binding2 = require("@rspack/binding");
5246
+ var APIPlugin = create2(import_binding2.BuiltinPluginName.APIPlugin, () => {
5147
5247
  });
5148
5248
 
5149
5249
  // src/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.ts
5150
- var import_binding8 = require("@rspack/binding");
5250
+ var import_binding3 = require("@rspack/binding");
5151
5251
  var ArrayPushCallbackChunkFormatPlugin = create2(
5152
- import_binding8.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin,
5252
+ import_binding3.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin,
5153
5253
  () => {
5154
5254
  }
5155
5255
  );
5156
5256
 
5157
5257
  // src/builtin-plugin/AssetModulesPlugin.ts
5158
- var import_binding9 = require("@rspack/binding");
5258
+ var import_binding4 = require("@rspack/binding");
5159
5259
  var AssetModulesPlugin = create2(
5160
- import_binding9.BuiltinPluginName.AssetModulesPlugin,
5260
+ import_binding4.BuiltinPluginName.AssetModulesPlugin,
5161
5261
  () => {
5162
5262
  },
5163
5263
  "compilation"
5164
5264
  );
5165
5265
 
5166
5266
  // src/builtin-plugin/AsyncWebAssemblyModulesPlugin.ts
5167
- var import_binding10 = require("@rspack/binding");
5267
+ var import_binding5 = require("@rspack/binding");
5168
5268
  var AsyncWebAssemblyModulesPlugin = create2(
5169
- import_binding10.BuiltinPluginName.AsyncWebAssemblyModulesPlugin,
5269
+ import_binding5.BuiltinPluginName.AsyncWebAssemblyModulesPlugin,
5170
5270
  () => {
5171
5271
  },
5172
5272
  "compilation"
5173
5273
  );
5174
5274
 
5175
5275
  // src/builtin-plugin/BannerPlugin.ts
5176
- var import_binding11 = require("@rspack/binding");
5276
+ var import_binding6 = require("@rspack/binding");
5177
5277
  var BannerPlugin = create2(
5178
- import_binding11.BuiltinPluginName.BannerPlugin,
5278
+ import_binding6.BuiltinPluginName.BannerPlugin,
5179
5279
  (args) => {
5180
5280
  if (typeof args === "string" || typeof args === "function") {
5181
5281
  return {
@@ -5196,9 +5296,9 @@ var BannerPlugin = create2(
5196
5296
  );
5197
5297
 
5198
5298
  // src/builtin-plugin/BundlerInfoRspackPlugin.ts
5199
- var import_binding12 = require("@rspack/binding");
5299
+ var import_binding7 = require("@rspack/binding");
5200
5300
  var BundlerInfoRspackPlugin = create2(
5201
- import_binding12.BuiltinPluginName.BundlerInfoRspackPlugin,
5301
+ import_binding7.BuiltinPluginName.BundlerInfoRspackPlugin,
5202
5302
  (options) => {
5203
5303
  return {
5204
5304
  version: options.version || "unknown",
@@ -5209,25 +5309,25 @@ var BundlerInfoRspackPlugin = create2(
5209
5309
  );
5210
5310
 
5211
5311
  // src/builtin-plugin/ChunkPrefetchPreloadPlugin.ts
5212
- var import_binding13 = require("@rspack/binding");
5312
+ var import_binding8 = require("@rspack/binding");
5213
5313
  var ChunkPrefetchPreloadPlugin = create2(
5214
- import_binding13.BuiltinPluginName.ChunkPrefetchPreloadPlugin,
5314
+ import_binding8.BuiltinPluginName.ChunkPrefetchPreloadPlugin,
5215
5315
  () => {
5216
5316
  }
5217
5317
  );
5218
5318
 
5219
5319
  // src/builtin-plugin/CommonJsChunkFormatPlugin.ts
5220
- var import_binding14 = require("@rspack/binding");
5320
+ var import_binding9 = require("@rspack/binding");
5221
5321
  var CommonJsChunkFormatPlugin = create2(
5222
- import_binding14.BuiltinPluginName.CommonJsChunkFormatPlugin,
5322
+ import_binding9.BuiltinPluginName.CommonJsChunkFormatPlugin,
5223
5323
  () => {
5224
5324
  }
5225
5325
  );
5226
5326
 
5227
5327
  // src/builtin-plugin/CopyRspackPlugin.ts
5228
- var import_binding15 = require("@rspack/binding");
5328
+ var import_binding10 = require("@rspack/binding");
5229
5329
  var CopyRspackPlugin = create2(
5230
- import_binding15.BuiltinPluginName.CopyRspackPlugin,
5330
+ import_binding10.BuiltinPluginName.CopyRspackPlugin,
5231
5331
  (copy) => {
5232
5332
  const ret = {
5233
5333
  patterns: []
@@ -5247,7 +5347,7 @@ var CopyRspackPlugin = create2(
5247
5347
  );
5248
5348
 
5249
5349
  // src/builtin-plugin/css-extract/index.ts
5250
- var import_binding16 = require("@rspack/binding");
5350
+ var import_binding11 = require("@rspack/binding");
5251
5351
  var import_node_path3 = require("path");
5252
5352
 
5253
5353
  // src/builtin-plugin/css-extract/loader.ts
@@ -5283,7 +5383,7 @@ var CssExtractRspackPlugin = class {
5283
5383
  this.options.pathinfo = true;
5284
5384
  }
5285
5385
  compiler.__internal__registerBuiltinPlugin({
5286
- name: import_binding16.BuiltinPluginName.CssExtractRspackPlugin,
5386
+ name: import_binding11.BuiltinPluginName.CssExtractRspackPlugin,
5287
5387
  options: this.normalizeOptions(this.options)
5288
5388
  });
5289
5389
  }
@@ -5332,7 +5432,8 @@ var CssExtractRspackPlugin = class {
5332
5432
  obj[k] = v;
5333
5433
  return obj;
5334
5434
  }, {}) : {},
5335
- pathinfo: options.pathinfo ?? false
5435
+ pathinfo: options.pathinfo ?? false,
5436
+ enforceRelative: options.enforceRelative ?? false
5336
5437
  };
5337
5438
  return normalzedOptions;
5338
5439
  }
@@ -5341,27 +5442,27 @@ CssExtractRspackPlugin.pluginName = PLUGIN_NAME;
5341
5442
  CssExtractRspackPlugin.loader = LOADER_PATH;
5342
5443
 
5343
5444
  // src/builtin-plugin/CssModulesPlugin.ts
5344
- var import_binding17 = require("@rspack/binding");
5445
+ var import_binding12 = require("@rspack/binding");
5345
5446
  var CssModulesPlugin = create2(
5346
- import_binding17.BuiltinPluginName.CssModulesPlugin,
5447
+ import_binding12.BuiltinPluginName.CssModulesPlugin,
5347
5448
  () => {
5348
5449
  },
5349
5450
  "compilation"
5350
5451
  );
5351
5452
 
5352
5453
  // src/builtin-plugin/DataUriPlugin.ts
5353
- var import_binding18 = require("@rspack/binding");
5454
+ var import_binding13 = require("@rspack/binding");
5354
5455
  var DataUriPlugin = create2(
5355
- import_binding18.BuiltinPluginName.DataUriPlugin,
5456
+ import_binding13.BuiltinPluginName.DataUriPlugin,
5356
5457
  () => {
5357
5458
  },
5358
5459
  "compilation"
5359
5460
  );
5360
5461
 
5361
5462
  // src/builtin-plugin/DefinePlugin.ts
5362
- var import_binding19 = require("@rspack/binding");
5463
+ var import_binding14 = require("@rspack/binding");
5363
5464
  var DefinePlugin = create2(
5364
- import_binding19.BuiltinPluginName.DefinePlugin,
5465
+ import_binding14.BuiltinPluginName.DefinePlugin,
5365
5466
  function(define) {
5366
5467
  var _a;
5367
5468
  const supportsBigIntLiteral = ((_a = this.options.output.environment) == null ? void 0 : _a.bigIntLiteral) ?? false;
@@ -5405,20 +5506,34 @@ var normalizeValue = (define, supportsBigIntLiteral) => {
5405
5506
  };
5406
5507
 
5407
5508
  // src/builtin-plugin/DeterministicChunkIdsPlugin.ts
5408
- var import_binding20 = require("@rspack/binding");
5409
- var DeterministicChunkIdsPlugin = create2(
5410
- import_binding20.BuiltinPluginName.DeterministicChunkIdsPlugin,
5411
- () => {
5412
- },
5413
- "compilation"
5414
- );
5509
+ var import_binding15 = require("@rspack/binding");
5510
+ var DeterministicChunkIdsPlugin = class extends RspackBuiltinPlugin {
5511
+ constructor() {
5512
+ super(...arguments);
5513
+ this.name = import_binding15.BuiltinPluginName.DeterministicChunkIdsPlugin;
5514
+ this.affectedHooks = "compilation";
5515
+ }
5516
+ raw(compiler) {
5517
+ const incremental2 = compiler.options.experiments.incremental;
5518
+ const logger = compiler.getInfrastructureLogger(
5519
+ "rspack.DeterministicChunkIdsPlugin"
5520
+ );
5521
+ if (incremental2.chunkIds) {
5522
+ incremental2.chunkIds = false;
5523
+ logger.warn(
5524
+ "`optimization.chunkIds = 'deterministic'` can't be used with `incremental.chunkIds` as deterministic chunk ids is a global effect. `incremental.chunkIds` has been overridden to false. We recommend enabling incremental only in the development mode."
5525
+ );
5526
+ }
5527
+ return createBuiltinPlugin(this.name, void 0);
5528
+ }
5529
+ };
5415
5530
 
5416
5531
  // src/builtin-plugin/DeterministicModuleIdsPlugin.ts
5417
- var import_binding21 = require("@rspack/binding");
5532
+ var import_binding16 = require("@rspack/binding");
5418
5533
  var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
5419
5534
  constructor() {
5420
5535
  super(...arguments);
5421
- this.name = import_binding21.BuiltinPluginName.DeterministicModuleIdsPlugin;
5536
+ this.name = import_binding16.BuiltinPluginName.DeterministicModuleIdsPlugin;
5422
5537
  this.affectedHooks = "compilation";
5423
5538
  }
5424
5539
  raw(compiler) {
@@ -5429,7 +5544,7 @@ var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
5429
5544
  if (incremental2.moduleIds) {
5430
5545
  incremental2.moduleIds = false;
5431
5546
  logger.warn(
5432
- "`optimization.moduleIds = 'deterministic'` can't be used with `incremental.moduleIds` as deterministic module ids is a global effect. `incremental.moduleIds` has been overridden to false."
5547
+ "`optimization.moduleIds = 'deterministic'` can't be used with `incremental.moduleIds` as deterministic module ids is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
5433
5548
  );
5434
5549
  }
5435
5550
  return createBuiltinPlugin(this.name, void 0);
@@ -5437,7 +5552,7 @@ var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
5437
5552
  };
5438
5553
 
5439
5554
  // src/builtin-plugin/DynamicEntryPlugin.ts
5440
- var import_binding25 = require("@rspack/binding");
5555
+ var import_binding18 = require("@rspack/binding");
5441
5556
 
5442
5557
  // src/lib/EntryOptionPlugin.ts
5443
5558
  var import_node_assert = __toESM(require("assert"));
@@ -5510,11 +5625,170 @@ var EntryOptionPlugin = class _EntryOptionPlugin {
5510
5625
  var EntryOptionPlugin_default = EntryOptionPlugin;
5511
5626
 
5512
5627
  // src/builtin-plugin/EntryPlugin.ts
5628
+ var import_binding17 = require("@rspack/binding");
5629
+ var OriginEntryPlugin = create2(
5630
+ import_binding17.BuiltinPluginName.EntryPlugin,
5631
+ (context2, entry2, options = "") => {
5632
+ const entryOptions = typeof options === "string" ? { name: options } : options;
5633
+ return {
5634
+ context: context2,
5635
+ entry: entry2,
5636
+ options: getRawEntryOptions(entryOptions)
5637
+ };
5638
+ },
5639
+ "make"
5640
+ );
5641
+ var EntryPlugin = OriginEntryPlugin;
5642
+ EntryPlugin.createDependency = (request) => {
5643
+ return {
5644
+ request
5645
+ };
5646
+ };
5647
+ function getRawEntryOptions(entry2) {
5648
+ const runtime = entry2.runtime;
5649
+ const chunkLoading2 = entry2.chunkLoading;
5650
+ return {
5651
+ name: entry2.name,
5652
+ publicPath: entry2.publicPath,
5653
+ baseUri: entry2.baseUri,
5654
+ runtime,
5655
+ chunkLoading: chunkLoading2,
5656
+ asyncChunks: entry2.asyncChunks,
5657
+ filename: entry2.filename,
5658
+ library: entry2.library,
5659
+ layer: entry2.layer ?? void 0,
5660
+ dependOn: entry2.dependOn
5661
+ };
5662
+ }
5663
+
5664
+ // src/builtin-plugin/DynamicEntryPlugin.ts
5665
+ var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
5666
+ constructor(context2, entry2) {
5667
+ super();
5668
+ this.context = context2;
5669
+ this.entry = entry2;
5670
+ this.name = import_binding18.BuiltinPluginName.DynamicEntryPlugin;
5671
+ this.affectedHooks = "make";
5672
+ }
5673
+ raw(compiler) {
5674
+ const raw = {
5675
+ context: this.context,
5676
+ entry: async () => {
5677
+ const result2 = await this.entry();
5678
+ return Object.entries(result2).map(([name2, desc]) => {
5679
+ const options = EntryOptionPlugin_default.entryDescriptionToOptions(
5680
+ compiler,
5681
+ name2,
5682
+ desc
5683
+ );
5684
+ return {
5685
+ import: desc.import,
5686
+ options: getRawEntryOptions(options)
5687
+ };
5688
+ });
5689
+ }
5690
+ };
5691
+ return createBuiltinPlugin(this.name, raw);
5692
+ }
5693
+ };
5694
+
5695
+ // src/builtin-plugin/ElectronTargetPlugin.ts
5696
+ var import_binding19 = require("@rspack/binding");
5697
+ var ElectronTargetPlugin = create2(
5698
+ import_binding19.BuiltinPluginName.ElectronTargetPlugin,
5699
+ (context2) => context2 ?? "none"
5700
+ );
5701
+
5702
+ // src/builtin-plugin/EnableChunkLoadingPlugin.ts
5703
+ var import_binding20 = require("@rspack/binding");
5704
+ var EnableChunkLoadingPlugin = create2(
5705
+ import_binding20.BuiltinPluginName.EnableChunkLoadingPlugin,
5706
+ (type) => type
5707
+ );
5708
+
5709
+ // src/builtin-plugin/EnableLibraryPlugin.ts
5710
+ var import_binding21 = require("@rspack/binding");
5711
+ var enabledTypes = /* @__PURE__ */ new WeakMap();
5712
+ var getEnabledTypes = (compiler) => {
5713
+ let set = enabledTypes.get(compiler);
5714
+ if (set === void 0) {
5715
+ set = /* @__PURE__ */ new Set();
5716
+ enabledTypes.set(compiler, set);
5717
+ }
5718
+ return set;
5719
+ };
5720
+ var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
5721
+ constructor(type) {
5722
+ super();
5723
+ this.type = type;
5724
+ this.name = import_binding21.BuiltinPluginName.EnableLibraryPlugin;
5725
+ }
5726
+ static setEnabled(compiler, type) {
5727
+ getEnabledTypes(compiler).add(type);
5728
+ }
5729
+ static checkEnabled(compiler, type) {
5730
+ if (!getEnabledTypes(compiler).has(type)) {
5731
+ throw new Error(
5732
+ `Library type "${type}" is not enabled. EnableLibraryPlugin need to be used to enable this type of library. This usually happens through the "output.enabledLibraryTypes" option. If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". These types are enabled: ${Array.from(getEnabledTypes(compiler)).join(", ")}`
5733
+ );
5734
+ }
5735
+ }
5736
+ raw(compiler) {
5737
+ const { type } = this;
5738
+ const enabled = getEnabledTypes(compiler);
5739
+ if (enabled.has(type)) return;
5740
+ enabled.add(type);
5741
+ return createBuiltinPlugin(this.name, type);
5742
+ }
5743
+ };
5744
+
5745
+ // src/builtin-plugin/EnableWasmLoadingPlugin.ts
5746
+ var import_binding22 = require("@rspack/binding");
5747
+ var EnableWasmLoadingPlugin = create2(
5748
+ import_binding22.BuiltinPluginName.EnableWasmLoadingPlugin,
5749
+ (type) => type
5750
+ );
5751
+
5752
+ // src/builtin-plugin/EnsureChunkConditionsPlugin.ts
5753
+ var import_binding23 = require("@rspack/binding");
5754
+ var EnsureChunkConditionsPlugin = create2(
5755
+ import_binding23.BuiltinPluginName.EnsureChunkConditionsPlugin,
5756
+ () => {
5757
+ }
5758
+ );
5759
+
5760
+ // src/builtin-plugin/EvalDevToolModulePlugin.ts
5513
5761
  var import_binding24 = require("@rspack/binding");
5762
+ var EvalDevToolModulePlugin = create2(
5763
+ import_binding24.BuiltinPluginName.EvalDevToolModulePlugin,
5764
+ (options) => options,
5765
+ "compilation"
5766
+ );
5767
+
5768
+ // src/builtin-plugin/EvalSourceMapDevToolPlugin.ts
5769
+ var import_binding25 = require("@rspack/binding");
5770
+ var EvalSourceMapDevToolPlugin = create2(
5771
+ import_binding25.BuiltinPluginName.EvalSourceMapDevToolPlugin,
5772
+ (options) => {
5773
+ return {
5774
+ filename: options.filename || void 0,
5775
+ append: options.append,
5776
+ namespace: options.namespace ?? "",
5777
+ columns: options.columns ?? true,
5778
+ noSources: options.noSources ?? false,
5779
+ publicPath: options.publicPath,
5780
+ module: options.module
5781
+ };
5782
+ },
5783
+ "compilation"
5784
+ );
5785
+
5786
+ // src/builtin-plugin/ExternalsPlugin.ts
5787
+ var import_binding28 = require("@rspack/binding");
5514
5788
 
5515
5789
  // src/config/adapter.ts
5516
5790
  var import_node_assert3 = __toESM(require("assert"));
5517
- var import_binding23 = require("@rspack/binding");
5791
+ var import_binding27 = require("@rspack/binding");
5518
5792
 
5519
5793
  // src/util/identifier.ts
5520
5794
  var import_node_path4 = __toESM(require("path"));
@@ -5822,7 +6096,7 @@ function toFeatures(featureOptions) {
5822
6096
  var import_node_querystring = __toESM(require("querystring"));
5823
6097
  var import_node_assert2 = __toESM(require("assert"));
5824
6098
  var import_node_util3 = require("util");
5825
- var import_binding22 = require("@rspack/binding");
6099
+ var import_binding26 = require("@rspack/binding");
5826
6100
  var import_webpack_sources2 = require("../compiled/webpack-sources/index.js");
5827
6101
 
5828
6102
  // src/NormalModule.ts
@@ -6023,7 +6297,7 @@ var LoaderObject = class {
6023
6297
  constructor(loaderItem, compiler) {
6024
6298
  const {
6025
6299
  request,
6026
- path: path10,
6300
+ path: path11,
6027
6301
  query,
6028
6302
  fragment,
6029
6303
  options,
@@ -6034,7 +6308,7 @@ var LoaderObject = class {
6034
6308
  type
6035
6309
  } = createLoaderObject(loaderItem, compiler);
6036
6310
  this.request = request;
6037
- this.path = path10;
6311
+ this.path = path11;
6038
6312
  this.query = query;
6039
6313
  this.fragment = fragment;
6040
6314
  this.options = options;
@@ -6161,17 +6435,17 @@ var runSyncOrAsync = (0, import_node_util3.promisify)(function runSyncOrAsync2(f
6161
6435
  callback(e, []);
6162
6436
  }
6163
6437
  });
6164
- function dirname(path10) {
6165
- if (path10 === "/") return "/";
6166
- const i = path10.lastIndexOf("/");
6167
- const j = path10.lastIndexOf("\\");
6168
- const i2 = path10.indexOf("/");
6169
- const j2 = path10.indexOf("\\");
6438
+ function dirname(path11) {
6439
+ if (path11 === "/") return "/";
6440
+ const i = path11.lastIndexOf("/");
6441
+ const j = path11.lastIndexOf("\\");
6442
+ const i2 = path11.indexOf("/");
6443
+ const j2 = path11.indexOf("\\");
6170
6444
  const idx = i > j ? i : j;
6171
6445
  const idx2 = i > j ? i2 : j2;
6172
- if (idx < 0) return path10;
6173
- if (idx === idx2) return path10.slice(0, idx + 1);
6174
- return path10.slice(0, idx);
6446
+ if (idx < 0) return path11;
6447
+ if (idx === idx2) return path11.slice(0, idx + 1);
6448
+ return path11.slice(0, idx);
6175
6449
  }
6176
6450
  function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
6177
6451
  var _a;
@@ -6230,6 +6504,37 @@ async function runLoaders(compiler, context2) {
6230
6504
  };
6231
6505
  loaderContext.importModule = function importModule(request, userOptions, callback) {
6232
6506
  const options = userOptions ? userOptions : {};
6507
+ const context3 = this;
6508
+ function finalCallback(onError, onDone) {
6509
+ return function(err, res) {
6510
+ if (err) {
6511
+ onError(err);
6512
+ } else {
6513
+ for (const dep of res.buildDependencies) {
6514
+ context3.addBuildDependency(dep);
6515
+ }
6516
+ for (const dep of res.contextDependencies) {
6517
+ context3.addContextDependency(dep);
6518
+ }
6519
+ for (const dep of res.missingDependencies) {
6520
+ context3.addMissingDependency(dep);
6521
+ }
6522
+ for (const dep of res.fileDependencies) {
6523
+ context3.addDependency(dep);
6524
+ }
6525
+ if (res.cacheable === false) {
6526
+ context3.cacheable(false);
6527
+ }
6528
+ if (res.error) {
6529
+ onError(
6530
+ compiler.__internal__getModuleExecutionResult(res.id) ?? new Error(err)
6531
+ );
6532
+ } else {
6533
+ onDone(compiler.__internal__getModuleExecutionResult(res.id));
6534
+ }
6535
+ }
6536
+ };
6537
+ }
6233
6538
  if (!callback) {
6234
6539
  return new Promise((resolve2, reject) => {
6235
6540
  compiler._lastCompilation.__internal_getInner().importModule(
@@ -6237,35 +6542,9 @@ async function runLoaders(compiler, context2) {
6237
6542
  options.layer,
6238
6543
  options.publicPath,
6239
6544
  options.baseUri,
6240
- context2._module.moduleIdentifier,
6545
+ context3._module.identifier(),
6241
6546
  loaderContext.context,
6242
- (err, res) => {
6243
- if (err) reject(err);
6244
- else {
6245
- for (const dep of res.buildDependencies) {
6246
- this.addBuildDependency(dep);
6247
- }
6248
- for (const dep of res.contextDependencies) {
6249
- this.addContextDependency(dep);
6250
- }
6251
- for (const dep of res.missingDependencies) {
6252
- this.addMissingDependency(dep);
6253
- }
6254
- for (const dep of res.fileDependencies) {
6255
- this.addDependency(dep);
6256
- }
6257
- if (res.cacheable === false) {
6258
- this.cacheable(false);
6259
- }
6260
- if (res.error) {
6261
- reject(new Error(res.error));
6262
- } else {
6263
- resolve2(
6264
- compiler.__internal__getModuleExecutionResult(res.id)
6265
- );
6266
- }
6267
- }
6268
- }
6547
+ finalCallback(reject, resolve2)
6269
6548
  );
6270
6549
  });
6271
6550
  }
@@ -6274,37 +6553,12 @@ async function runLoaders(compiler, context2) {
6274
6553
  options.layer,
6275
6554
  options.publicPath,
6276
6555
  options.baseUri,
6277
- context2._module.moduleIdentifier,
6556
+ context3._module.identifier(),
6278
6557
  loaderContext.context,
6279
- (err, res) => {
6280
- if (err) {
6281
- callback(err, void 0);
6282
- } else {
6283
- for (const dep of res.buildDependencies) {
6284
- this.addBuildDependency(dep);
6285
- }
6286
- for (const dep of res.contextDependencies) {
6287
- this.addContextDependency(dep);
6288
- }
6289
- for (const dep of res.missingDependencies) {
6290
- this.addMissingDependency(dep);
6291
- }
6292
- for (const dep of res.fileDependencies) {
6293
- this.addDependency(dep);
6294
- }
6295
- if (res.cacheable === false) {
6296
- this.cacheable(false);
6297
- }
6298
- if (res.error) {
6299
- callback(new Error(err), void 0);
6300
- } else {
6301
- callback(
6302
- void 0,
6303
- compiler.__internal__getModuleExecutionResult(res.id)
6304
- );
6305
- }
6306
- }
6307
- }
6558
+ finalCallback(
6559
+ (err) => callback(err),
6560
+ (res) => callback(void 0, res)
6561
+ )
6308
6562
  );
6309
6563
  };
6310
6564
  Object.defineProperty(loaderContext, "resource", {
@@ -6417,7 +6671,7 @@ async function runLoaders(compiler, context2) {
6417
6671
  error.moduleIdentifier = this._module.identifier();
6418
6672
  compiler._lastCompilation.__internal__pushRspackDiagnostic({
6419
6673
  error,
6420
- severity: import_binding22.JsRspackSeverity.Error
6674
+ severity: import_binding26.JsRspackSeverity.Error
6421
6675
  });
6422
6676
  };
6423
6677
  loaderContext.emitWarning = function emitWarning(warn) {
@@ -6433,7 +6687,7 @@ async function runLoaders(compiler, context2) {
6433
6687
  warning.moduleIdentifier = this._module.identifier();
6434
6688
  compiler._lastCompilation.__internal__pushRspackDiagnostic({
6435
6689
  error: warning,
6436
- severity: import_binding22.JsRspackSeverity.Warn
6690
+ severity: import_binding26.JsRspackSeverity.Warn
6437
6691
  });
6438
6692
  };
6439
6693
  loaderContext.emitFile = function emitFile(name2, content, sourceMap, assetInfo) {
@@ -6474,7 +6728,7 @@ async function runLoaders(compiler, context2) {
6474
6728
  moduleIdentifier: context2._module.moduleIdentifier
6475
6729
  });
6476
6730
  compiler._lastCompilation.__internal__pushDiagnostic(
6477
- (0, import_binding22.formatDiagnostic)(d)
6731
+ (0, import_binding26.formatDiagnostic)(d)
6478
6732
  );
6479
6733
  }
6480
6734
  };
@@ -6501,10 +6755,7 @@ async function runLoaders(compiler, context2) {
6501
6755
  };
6502
6756
  loaderContext._compiler = compiler;
6503
6757
  loaderContext._compilation = compiler._lastCompilation;
6504
- loaderContext._module = Module.__from_binding(
6505
- context2._module,
6506
- compiler._lastCompilation
6507
- );
6758
+ loaderContext._module = Module.__from_binding(context2._module);
6508
6759
  loaderContext.getOptions = () => {
6509
6760
  const loader2 = getCurrentLoader(loaderContext);
6510
6761
  let options = loader2 == null ? void 0 : loader2.options;
@@ -6564,7 +6815,7 @@ async function runLoaders(compiler, context2) {
6564
6815
  });
6565
6816
  try {
6566
6817
  switch (loaderState) {
6567
- case import_binding22.JsLoaderState.Pitching: {
6818
+ case import_binding26.JsLoaderState.Pitching: {
6568
6819
  while (loaderContext.loaderIndex < loaderContext.loaders.length) {
6569
6820
  const currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
6570
6821
  if (currentLoaderObject.shouldYield()) break;
@@ -6592,7 +6843,7 @@ async function runLoaders(compiler, context2) {
6592
6843
  }
6593
6844
  break;
6594
6845
  }
6595
- case import_binding22.JsLoaderState.Normal: {
6846
+ case import_binding26.JsLoaderState.Normal: {
6596
6847
  let content = context2.content;
6597
6848
  let sourceMap = JsSourceMap.__from_binding(context2.sourceMap);
6598
6849
  let additionalData = context2.additionalData;
@@ -6660,10 +6911,10 @@ function parsePathQueryFragment(str) {
6660
6911
 
6661
6912
  // src/config/adapterRuleUse.ts
6662
6913
  var BUILTIN_LOADER_PREFIX = "builtin:";
6663
- function createRawModuleRuleUses(uses, path10, options) {
6914
+ function createRawModuleRuleUses(uses, path11, options) {
6664
6915
  const normalizeRuleSetUseItem = (item) => typeof item === "string" ? { loader: item } : item;
6665
6916
  const allUses = Array.isArray(uses) ? [...uses].map(normalizeRuleSetUseItem) : [normalizeRuleSetUseItem(uses)];
6666
- return createRawModuleRuleUsesImpl(allUses, path10, options);
6917
+ return createRawModuleRuleUsesImpl(allUses, path11, options);
6667
6918
  }
6668
6919
  var getSwcLoaderOptions = (options, _) => {
6669
6920
  if (options && typeof options === "object") {
@@ -6704,7 +6955,7 @@ function getBuiltinLoaderOptions(identifier, o, options) {
6704
6955
  }
6705
6956
  return o;
6706
6957
  }
6707
- function createRawModuleRuleUsesImpl(uses, path10, options) {
6958
+ function createRawModuleRuleUsesImpl(uses, path11, options) {
6708
6959
  if (!uses.length) {
6709
6960
  return [];
6710
6961
  }
@@ -6719,7 +6970,7 @@ function createRawModuleRuleUsesImpl(uses, path10, options) {
6719
6970
  return {
6720
6971
  loader: resolveStringifyLoaders(
6721
6972
  use,
6722
- `${path10}[${index}]`,
6973
+ `${path11}[${index}]`,
6723
6974
  options.compiler,
6724
6975
  isBuiltin
6725
6976
  ),
@@ -6727,7 +6978,7 @@ function createRawModuleRuleUsesImpl(uses, path10, options) {
6727
6978
  };
6728
6979
  });
6729
6980
  }
6730
- function resolveStringifyLoaders(use, path10, compiler, isBuiltin) {
6981
+ function resolveStringifyLoaders(use, path11, compiler, isBuiltin) {
6731
6982
  const obj = parsePathQueryFragment(use.loader);
6732
6983
  let ident = null;
6733
6984
  if (use.options === null) {
@@ -6736,7 +6987,7 @@ function resolveStringifyLoaders(use, path10, compiler, isBuiltin) {
6736
6987
  else if (use.ident) obj.query = `??${ident = use.ident}`;
6737
6988
  else if (typeof use.options === "object" && use.options.ident)
6738
6989
  obj.query = `??${ident = use.options.ident}`;
6739
- else if (typeof use.options === "object") obj.query = `??${ident = path10}`;
6990
+ else if (typeof use.options === "object") obj.query = `??${ident = path11}`;
6740
6991
  else obj.query = `?${JSON.stringify(use.options)}`;
6741
6992
  if (use.options && typeof use.options === "object") {
6742
6993
  if (!ident) ident = "[[missing ident]]";
@@ -6748,70 +6999,48 @@ function resolveStringifyLoaders(use, path10, compiler, isBuiltin) {
6748
6999
  return obj.path + obj.query + obj.fragment;
6749
7000
  }
6750
7001
  function isUseSourceMap(devtool) {
7002
+ if (!devtool) {
7003
+ return false;
7004
+ }
6751
7005
  return devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
6752
7006
  }
6753
7007
  function isUseSimpleSourceMap(devtool) {
7008
+ if (!devtool) {
7009
+ return false;
7010
+ }
6754
7011
  return devtool.includes("source-map") && !isUseSourceMap(devtool);
6755
7012
  }
6756
7013
 
6757
7014
  // src/config/adapter.ts
6758
7015
  var getRawOptions = (options, compiler) => {
6759
- (0, import_node_assert3.default)(
6760
- !isNil(options.context) && !isNil(options.devtool) && !isNil(options.cache),
6761
- "context, devtool, cache should not be nil after defaults"
6762
- );
6763
- const devtool = options.devtool === false ? "" : options.devtool;
6764
7016
  const mode2 = options.mode;
6765
- const experiments3 = getRawExperiments(options.experiments);
7017
+ const experiments3 = options.experiments;
6766
7018
  return {
7019
+ name: options.name,
6767
7020
  mode: mode2,
6768
- target: getRawTarget(options.target),
6769
7021
  context: options.context,
6770
- output: getRawOutput(options.output),
7022
+ output: options.output,
6771
7023
  resolve: getRawResolve(options.resolve),
6772
7024
  resolveLoader: getRawResolve(options.resolveLoader),
6773
7025
  module: getRawModule(options.module, {
6774
7026
  compiler,
6775
- devtool,
6776
7027
  mode: mode2,
6777
7028
  context: options.context,
6778
7029
  experiments: experiments3
6779
7030
  }),
6780
- devtool,
6781
- optimization: getRawOptimization(options.optimization),
7031
+ optimization: options.optimization,
6782
7032
  stats: getRawStats(options.stats),
6783
- snapshot: getRawSnapshotOptions(options.snapshot),
6784
7033
  cache: {
6785
- type: options.cache ? "memory" : "disable",
6786
- // TODO: implement below cache options
6787
- maxGenerations: 0,
6788
- maxAge: 0,
6789
- profile: false,
6790
- buildDependencies: [],
6791
- cacheDirectory: "",
6792
- cacheLocation: "",
6793
- name: "",
6794
- version: ""
7034
+ type: options.cache ? "memory" : "disable"
6795
7035
  },
6796
7036
  experiments: experiments3,
6797
7037
  node: getRawNode(options.node),
6798
- // SAFETY: applied default value in `applyRspackOptionsDefaults`.
6799
7038
  profile: options.profile,
6800
7039
  amd: options.amd,
6801
- // SAFETY: applied default value in `applyRspackOptionsDefaults`.
6802
7040
  bail: options.bail,
6803
7041
  __references: {}
6804
7042
  };
6805
7043
  };
6806
- function getRawTarget(target2) {
6807
- if (!target2) {
6808
- return [];
6809
- }
6810
- if (typeof target2 === "string") {
6811
- return [target2];
6812
- }
6813
- return target2;
6814
- }
6815
7044
  function getRawExtensionAlias(alias = {}) {
6816
7045
  const entries = Object.entries(alias).map(([key, value]) => {
6817
7046
  if (Array.isArray(value)) {
@@ -6856,111 +7085,6 @@ function getRawResolve(resolve2) {
6856
7085
  byDependency: getRawResolveByDependency(resolve2.byDependency)
6857
7086
  };
6858
7087
  }
6859
- function getRawCrossOriginLoading(crossOriginLoading2) {
6860
- if (typeof crossOriginLoading2 === "boolean") {
6861
- return { type: "bool", boolPayload: crossOriginLoading2 };
6862
- }
6863
- return { type: "string", stringPayload: crossOriginLoading2 };
6864
- }
6865
- function getRawOutput(output2) {
6866
- const chunkLoading2 = output2.chunkLoading;
6867
- const wasmLoading2 = output2.wasmLoading;
6868
- const workerChunkLoading = output2.workerChunkLoading;
6869
- const workerWasmLoading = output2.workerWasmLoading;
6870
- return {
6871
- path: output2.path,
6872
- pathinfo: output2.pathinfo,
6873
- publicPath: output2.publicPath,
6874
- clean: output2.clean,
6875
- assetModuleFilename: output2.assetModuleFilename,
6876
- filename: output2.filename,
6877
- chunkFilename: output2.chunkFilename,
6878
- chunkLoading: getRawChunkLoading(chunkLoading2),
6879
- crossOriginLoading: getRawCrossOriginLoading(output2.crossOriginLoading),
6880
- cssFilename: output2.cssFilename,
6881
- cssChunkFilename: output2.cssChunkFilename,
6882
- hotUpdateChunkFilename: output2.hotUpdateChunkFilename,
6883
- hotUpdateMainFilename: output2.hotUpdateMainFilename,
6884
- hotUpdateGlobal: output2.hotUpdateGlobal,
6885
- uniqueName: output2.uniqueName,
6886
- chunkLoadingGlobal: output2.chunkLoadingGlobal,
6887
- enabledLibraryTypes: output2.enabledLibraryTypes,
6888
- library: output2.library && getRawLibrary(output2.library),
6889
- strictModuleErrorHandling: output2.strictModuleErrorHandling,
6890
- globalObject: output2.globalObject,
6891
- importFunctionName: output2.importFunctionName,
6892
- importMetaName: output2.importMetaName,
6893
- iife: output2.iife,
6894
- module: output2.module,
6895
- wasmLoading: wasmLoading2 === false ? "false" : wasmLoading2,
6896
- enabledWasmLoadingTypes: output2.enabledWasmLoadingTypes,
6897
- enabledChunkLoadingTypes: output2.enabledChunkLoadingTypes,
6898
- webassemblyModuleFilename: output2.webassemblyModuleFilename,
6899
- trustedTypes: output2.trustedTypes,
6900
- sourceMapFilename: output2.sourceMapFilename,
6901
- hashFunction: output2.hashFunction,
6902
- hashDigest: output2.hashDigest,
6903
- hashDigestLength: output2.hashDigestLength,
6904
- hashSalt: output2.hashSalt,
6905
- asyncChunks: output2.asyncChunks,
6906
- workerChunkLoading: workerChunkLoading === false ? "false" : workerChunkLoading,
6907
- workerWasmLoading: workerWasmLoading === false ? "false" : workerWasmLoading,
6908
- workerPublicPath: output2.workerPublicPath,
6909
- scriptType: output2.scriptType === false ? "false" : output2.scriptType,
6910
- charset: output2.charset,
6911
- chunkLoadTimeout: output2.chunkLoadTimeout,
6912
- environment: output2.environment,
6913
- compareBeforeEmit: output2.compareBeforeEmit
6914
- };
6915
- }
6916
- function getRawLibrary(library3) {
6917
- const {
6918
- type,
6919
- name: name2,
6920
- export: libraryExport2,
6921
- umdNamedDefine: umdNamedDefine2,
6922
- auxiliaryComment: auxiliaryComment2,
6923
- amdContainer: amdContainer2
6924
- } = library3;
6925
- return {
6926
- amdContainer: amdContainer2,
6927
- auxiliaryComment: typeof auxiliaryComment2 === "string" ? {
6928
- commonjs: auxiliaryComment2,
6929
- commonjs2: auxiliaryComment2,
6930
- amd: auxiliaryComment2,
6931
- root: auxiliaryComment2
6932
- } : auxiliaryComment2,
6933
- libraryType: type,
6934
- name: isNil(name2) ? name2 : getRawLibraryName(name2),
6935
- export: Array.isArray(libraryExport2) || libraryExport2 == null ? libraryExport2 : [libraryExport2],
6936
- umdNamedDefine: umdNamedDefine2
6937
- };
6938
- }
6939
- function getRawLibraryName(name2) {
6940
- if (typeof name2 === "string") {
6941
- return {
6942
- type: "string",
6943
- stringPayload: name2
6944
- };
6945
- }
6946
- if (Array.isArray(name2)) {
6947
- return {
6948
- type: "array",
6949
- arrayPayload: name2
6950
- };
6951
- }
6952
- if (typeof name2 === "object" && !Array.isArray(name2)) {
6953
- return {
6954
- type: "umdObject",
6955
- umdObjectPayload: {
6956
- commonjs: name2.commonjs,
6957
- root: Array.isArray(name2.root) || isNil(name2.root) ? name2.root : [name2.root],
6958
- amd: name2.amd
6959
- }
6960
- };
6961
- }
6962
- throw new Error("unreachable");
6963
- }
6964
7088
  function getRawModule(module2, options) {
6965
7089
  (0, import_node_assert3.default)(
6966
7090
  !isNil(module2.defaultRules),
@@ -7006,7 +7130,7 @@ function tryMatch(payload, condition) {
7006
7130
  }
7007
7131
  return false;
7008
7132
  }
7009
- var getRawModuleRule = (rule, path10, options, upperType) => {
7133
+ var getRawModuleRule = (rule, path11, options, upperType) => {
7010
7134
  if (rule.loader) {
7011
7135
  rule.use = [
7012
7136
  {
@@ -7024,7 +7148,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7024
7148
  compiler: options.compiler
7025
7149
  };
7026
7150
  const uses = use(context2);
7027
- return createRawModuleRuleUses(uses ?? [], `${path10}.use`, options);
7151
+ return createRawModuleRuleUses(uses ?? [], `${path11}.use`, options);
7028
7152
  };
7029
7153
  }
7030
7154
  const rawModuleRule = {
@@ -7052,7 +7176,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7052
7176
  scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
7053
7177
  mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
7054
7178
  sideEffects: rule.sideEffects,
7055
- use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${path10}.use`, options),
7179
+ use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${path11}.use`, options),
7056
7180
  type: rule.type,
7057
7181
  layer: rule.layer,
7058
7182
  parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
@@ -7061,7 +7185,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7061
7185
  oneOf: rule.oneOf ? rule.oneOf.filter(Boolean).map(
7062
7186
  (rule2, index) => getRawModuleRule(
7063
7187
  rule2,
7064
- `${path10}.oneOf[${index}]`,
7188
+ `${path11}.oneOf[${index}]`,
7065
7189
  options,
7066
7190
  rule2.type ?? upperType
7067
7191
  )
@@ -7069,7 +7193,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7069
7193
  rules: rule.rules ? rule.rules.filter(Boolean).map(
7070
7194
  (rule2, index) => getRawModuleRule(
7071
7195
  rule2,
7072
- `${path10}.rules[${index}]`,
7196
+ `${path11}.rules[${index}]`,
7073
7197
  options,
7074
7198
  rule2.type ?? upperType
7075
7199
  )
@@ -7083,11 +7207,11 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7083
7207
  delete rawModuleRule.resourceFragment;
7084
7208
  rawModuleRule.rspackResource = getRawRuleSetCondition(
7085
7209
  (resourceQueryFragment) => {
7086
- const { path: path11, query, fragment } = parseResource(resourceQueryFragment);
7087
- if (rule.test && !tryMatch(path11, rule.test)) {
7210
+ const { path: path12, query, fragment } = parseResource(resourceQueryFragment);
7211
+ if (rule.test && !tryMatch(path12, rule.test)) {
7088
7212
  return false;
7089
7213
  }
7090
- if (rule.resource && !tryMatch(path11, rule.resource)) {
7214
+ if (rule.resource && !tryMatch(path12, rule.resource)) {
7091
7215
  return false;
7092
7216
  }
7093
7217
  if (rule.resourceQuery && !tryMatch(query, rule.resourceQuery)) {
@@ -7105,31 +7229,31 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
7105
7229
  function getRawRuleSetCondition(condition) {
7106
7230
  if (typeof condition === "string") {
7107
7231
  return {
7108
- type: import_binding23.RawRuleSetConditionType.string,
7232
+ type: import_binding27.RawRuleSetConditionType.string,
7109
7233
  string: condition
7110
7234
  };
7111
7235
  }
7112
7236
  if (condition instanceof RegExp) {
7113
7237
  return {
7114
- type: import_binding23.RawRuleSetConditionType.regexp,
7238
+ type: import_binding27.RawRuleSetConditionType.regexp,
7115
7239
  regexp: condition
7116
7240
  };
7117
7241
  }
7118
7242
  if (typeof condition === "function") {
7119
7243
  return {
7120
- type: import_binding23.RawRuleSetConditionType.func,
7244
+ type: import_binding27.RawRuleSetConditionType.func,
7121
7245
  func: condition
7122
7246
  };
7123
7247
  }
7124
7248
  if (Array.isArray(condition)) {
7125
7249
  return {
7126
- type: import_binding23.RawRuleSetConditionType.array,
7250
+ type: import_binding27.RawRuleSetConditionType.array,
7127
7251
  array: condition.map((i) => getRawRuleSetCondition(i))
7128
7252
  };
7129
7253
  }
7130
7254
  if (typeof condition === "object" && condition !== null) {
7131
7255
  return {
7132
- type: import_binding23.RawRuleSetConditionType.logical,
7256
+ type: import_binding27.RawRuleSetConditionType.logical,
7133
7257
  logical: [getRawRuleSetLogicalConditions(condition)]
7134
7258
  };
7135
7259
  }
@@ -7203,6 +7327,12 @@ function getRawParserOptions(parser, type) {
7203
7327
  cssModule: getRawCssParserOptions(parser)
7204
7328
  };
7205
7329
  }
7330
+ if (type === "json") {
7331
+ return {
7332
+ type: "json",
7333
+ json: getRawJsonParserOptions(parser)
7334
+ };
7335
+ }
7206
7336
  throw new Error(`unreachable: unknow module type: ${type}`);
7207
7337
  }
7208
7338
  function getRawJavascriptParserOptions(parser) {
@@ -7252,6 +7382,11 @@ function getRawCssParserOptions(parser) {
7252
7382
  namedExports: parser.namedExports
7253
7383
  };
7254
7384
  }
7385
+ function getRawJsonParserOptions(parser) {
7386
+ return {
7387
+ exportsDepth: parser.exportsDepth
7388
+ };
7389
+ }
7255
7390
  function getRawGeneratorOptions(generator, type) {
7256
7391
  if (type === "asset") {
7257
7392
  return {
@@ -7314,6 +7449,7 @@ function getRawAssetResourceGeneratorOptions(options) {
7314
7449
  return {
7315
7450
  emit: options.emit,
7316
7451
  filename: options.filename,
7452
+ outputPath: options.outputPath,
7317
7453
  publicPath: options.publicPath
7318
7454
  };
7319
7455
  }
@@ -7326,7 +7462,12 @@ function getRawAssetGeneratorDataUrl(dataUrl) {
7326
7462
  };
7327
7463
  }
7328
7464
  if (typeof dataUrl === "function" && dataUrl !== null) {
7329
- return dataUrl;
7465
+ return (source, context2) => {
7466
+ return dataUrl(source, {
7467
+ ...context2,
7468
+ module: Module.__from_binding(context2.module)
7469
+ });
7470
+ };
7330
7471
  }
7331
7472
  throw new Error(
7332
7473
  `unreachable: AssetGeneratorDataUrl type should be one of "options", "function", but got ${dataUrl}`
@@ -7346,79 +7487,6 @@ function getRawCssAutoOrModuleGeneratorOptions(options) {
7346
7487
  esModule: options.esModule
7347
7488
  };
7348
7489
  }
7349
- function getRawOptimization(optimization2) {
7350
- (0, import_node_assert3.default)(
7351
- !isNil(optimization2.removeAvailableModules) && !isNil(optimization2.sideEffects) && !isNil(optimization2.realContentHash) && !isNil(optimization2.providedExports) && !isNil(optimization2.usedExports) && !isNil(optimization2.innerGraph) && "optimization.moduleIds, optimization.removeAvailableModules, optimization.removeEmptyChunks, optimization.sideEffects, optimization.realContentHash, optimization.providedExports, optimization.usedExports, optimization.innerGraph, optimization.concatenateModules should not be nil after defaults"
7352
- );
7353
- return {
7354
- removeAvailableModules: optimization2.removeAvailableModules,
7355
- sideEffects: String(optimization2.sideEffects),
7356
- usedExports: String(optimization2.usedExports),
7357
- providedExports: optimization2.providedExports,
7358
- innerGraph: optimization2.innerGraph,
7359
- concatenateModules: !!optimization2.concatenateModules,
7360
- mangleExports: String(optimization2.mangleExports)
7361
- };
7362
- }
7363
- function getRawSnapshotOptions(_snapshot) {
7364
- return {};
7365
- }
7366
- function getRawExperiments(experiments3) {
7367
- const { topLevelAwait, layers, incremental: incremental2, rspackFuture, cache } = experiments3;
7368
- (0, import_node_assert3.default)(
7369
- !isNil(topLevelAwait) && !isNil(rspackFuture) && !isNil(layers) && !isNil(incremental2)
7370
- );
7371
- return {
7372
- layers,
7373
- topLevelAwait,
7374
- cache: getRawExperimentCache(cache),
7375
- incremental: getRawIncremental(incremental2),
7376
- rspackFuture: getRawRspackFutureOptions(rspackFuture)
7377
- };
7378
- }
7379
- function getRawExperimentCache(cache) {
7380
- if (cache === void 0) {
7381
- throw new Error("experiment cache can not be undefined");
7382
- }
7383
- if (typeof cache === "boolean") {
7384
- return {
7385
- type: cache ? "memory" : "disable"
7386
- };
7387
- }
7388
- if (cache.type === "persistent") {
7389
- const { type, snapshot, storage } = cache;
7390
- return {
7391
- type,
7392
- snapshot,
7393
- storage: [storage]
7394
- };
7395
- }
7396
- return cache;
7397
- }
7398
- function getRawIncremental(incremental2) {
7399
- if (incremental2 === false) {
7400
- return void 0;
7401
- }
7402
- return {
7403
- make: incremental2.make,
7404
- inferAsyncModules: incremental2.inferAsyncModules,
7405
- providedExports: incremental2.providedExports,
7406
- dependenciesDiagnostics: incremental2.dependenciesDiagnostics,
7407
- buildChunkGraph: incremental2.buildChunkGraph,
7408
- moduleIds: incremental2.moduleIds,
7409
- chunkIds: incremental2.chunkIds,
7410
- modulesHashes: incremental2.modulesHashes,
7411
- modulesCodegen: incremental2.modulesCodegen,
7412
- modulesRuntimeRequirements: incremental2.modulesRuntimeRequirements,
7413
- chunksRuntimeRequirements: incremental2.chunksRuntimeRequirements,
7414
- chunksHashes: incremental2.chunksHashes,
7415
- chunksRender: incremental2.chunksRender,
7416
- emitAssets: incremental2.emitAssets
7417
- };
7418
- }
7419
- function getRawRspackFutureOptions(future) {
7420
- return {};
7421
- }
7422
7490
  function getRawNode(node3) {
7423
7491
  if (node3 === false) {
7424
7492
  return void 0;
@@ -7438,9 +7506,6 @@ function getRawStats(stats) {
7438
7506
  colors: statsOptions2.colors ?? false
7439
7507
  };
7440
7508
  }
7441
- function getRawChunkLoading(chunkLoading2) {
7442
- return chunkLoading2 === false ? "false" : chunkLoading2;
7443
- }
7444
7509
 
7445
7510
  // src/config/defaults.ts
7446
7511
  var import_node_assert4 = __toESM(require("assert"));
@@ -7448,6 +7513,7 @@ var import_node_fs = __toESM(require("fs"));
7448
7513
  var import_node_path6 = __toESM(require("path"));
7449
7514
 
7450
7515
  // src/ModuleTypeConstants.ts
7516
+ var JSON_MODULE_TYPE = "json";
7451
7517
  var ASSET_MODULE_TYPE = "asset";
7452
7518
 
7453
7519
  // src/Template.ts
@@ -8531,12 +8597,19 @@ var applyRspackOptionsDefaults = (options) => {
8531
8597
  D(options, "profile", false);
8532
8598
  D(options, "bail", false);
8533
8599
  F(options, "cache", () => development);
8534
- applyExperimentsDefaults(options.experiments, { production });
8600
+ applyExperimentsDefaults(options.experiments, {
8601
+ production,
8602
+ development
8603
+ });
8604
+ if (options.cache === false) {
8605
+ options.experiments.cache = false;
8606
+ }
8535
8607
  applySnapshotDefaults(options.snapshot, { production });
8536
8608
  applyModuleDefaults(options.module, {
8537
8609
  asyncWebAssembly: options.experiments.asyncWebAssembly,
8538
8610
  css: options.experiments.css,
8539
- targetProperties
8611
+ targetProperties,
8612
+ mode: options.mode
8540
8613
  });
8541
8614
  applyOutputDefaults(options.output, {
8542
8615
  context: options.context,
@@ -8607,8 +8680,8 @@ var applyInfrastructureLoggingDefaults = (infrastructureLogging2) => {
8607
8680
  D(infrastructureLogging2, "colors", tty);
8608
8681
  D(infrastructureLogging2, "appendOnly", !tty);
8609
8682
  };
8610
- var applyExperimentsDefaults = (experiments3, { production }) => {
8611
- F(experiments3, "cache", () => !production);
8683
+ var applyExperimentsDefaults = (experiments3, { production, development }) => {
8684
+ F(experiments3, "cache", () => development);
8612
8685
  D(experiments3, "futureDefaults", false);
8613
8686
  D(experiments3, "lazyCompilation", false);
8614
8687
  D(experiments3, "asyncWebAssembly", experiments3.futureDefaults);
@@ -8621,6 +8694,7 @@ var applyExperimentsDefaults = (experiments3, { production }) => {
8621
8694
  D(experiments3.incremental, "inferAsyncModules", false);
8622
8695
  D(experiments3.incremental, "providedExports", false);
8623
8696
  D(experiments3.incremental, "dependenciesDiagnostics", false);
8697
+ D(experiments3.incremental, "sideEffects", false);
8624
8698
  D(experiments3.incremental, "buildChunkGraph", false);
8625
8699
  D(experiments3.incremental, "moduleIds", false);
8626
8700
  D(experiments3.incremental, "chunkIds", false);
@@ -8669,7 +8743,8 @@ var applyJavascriptParserOptionsDefaults = (parserOptions) => {
8669
8743
  var applyModuleDefaults = (module2, {
8670
8744
  asyncWebAssembly,
8671
8745
  css,
8672
- targetProperties
8746
+ targetProperties,
8747
+ mode: mode2
8673
8748
  }) => {
8674
8749
  assertNotNill(module2.parser);
8675
8750
  assertNotNill(module2.generator);
@@ -8682,6 +8757,13 @@ var applyModuleDefaults = (module2, {
8682
8757
  F(module2.parser, "javascript", () => ({}));
8683
8758
  assertNotNill(module2.parser.javascript);
8684
8759
  applyJavascriptParserOptionsDefaults(module2.parser.javascript);
8760
+ F(module2.parser, JSON_MODULE_TYPE, () => ({}));
8761
+ assertNotNill(module2.parser[JSON_MODULE_TYPE]);
8762
+ D(
8763
+ module2.parser[JSON_MODULE_TYPE],
8764
+ "exportsDepth",
8765
+ mode2 === "development" ? 1 : Number.MAX_SAFE_INTEGER
8766
+ );
8685
8767
  if (css) {
8686
8768
  F(module2.parser, "css", () => ({}));
8687
8769
  assertNotNill(module2.parser.css);
@@ -9230,6 +9312,7 @@ var applyOptimizationDefaults = (optimization2, {
9230
9312
  D(optimization2, "emitOnErrors", !production);
9231
9313
  D(optimization2, "runtimeChunk", false);
9232
9314
  D(optimization2, "realContentHash", production);
9315
+ D(optimization2, "avoidEntryIife", false);
9233
9316
  D(optimization2, "minimize", production);
9234
9317
  D(optimization2, "concatenateModules", production);
9235
9318
  A(optimization2, "minimizer", () => [
@@ -9406,6 +9489,7 @@ var A = (obj, prop, factory) => {
9406
9489
  };
9407
9490
 
9408
9491
  // src/config/normalization.ts
9492
+ var import_node_path7 = __toESM(require("path"));
9409
9493
  var import_node_util4 = __toESM(require("util"));
9410
9494
  var getNormalizedRspackOptions = (config2) => {
9411
9495
  return {
@@ -9582,7 +9666,38 @@ var getNormalizedRspackOptions = (config2) => {
9582
9666
  plugins: nestedArray(config2.plugins, (p) => [...p]),
9583
9667
  experiments: nestedConfig(config2.experiments, (experiments3) => ({
9584
9668
  ...experiments3,
9585
- cache: experiments3.cache,
9669
+ cache: optionalNestedConfig(experiments3.cache, (cache) => {
9670
+ var _a;
9671
+ if (typeof cache === "boolean") {
9672
+ return cache;
9673
+ }
9674
+ if (cache.type === "memory") {
9675
+ return cache;
9676
+ }
9677
+ const snapshot = cache.snapshot || {};
9678
+ return {
9679
+ type: "persistent",
9680
+ buildDependencies: nestedArray(
9681
+ cache.buildDependencies,
9682
+ (deps) => deps.map((d) => import_node_path7.default.resolve(config2.context || process.cwd(), d))
9683
+ ),
9684
+ version: cache.version || "",
9685
+ snapshot: {
9686
+ immutablePaths: nestedArray(snapshot.immutablePaths, (p) => [...p]),
9687
+ unmanagedPaths: nestedArray(snapshot.unmanagedPaths, (p) => [...p]),
9688
+ managedPaths: optionalNestedArray(snapshot.managedPaths, (p) => [
9689
+ ...p
9690
+ ]) || [/\/node_modules\//]
9691
+ },
9692
+ storage: {
9693
+ type: "filesystem",
9694
+ directory: import_node_path7.default.resolve(
9695
+ config2.context || process.cwd(),
9696
+ ((_a = cache.storage) == null ? void 0 : _a.directory) || "node_modules/.cache/rspack"
9697
+ )
9698
+ }
9699
+ };
9700
+ }),
9586
9701
  lazyCompilation: optionalNestedConfig(
9587
9702
  experiments3.lazyCompilation,
9588
9703
  (options) => options === true ? {} : options
@@ -9591,9 +9706,10 @@ var getNormalizedRspackOptions = (config2) => {
9591
9706
  experiments3.incremental,
9592
9707
  (options) => options === true ? {
9593
9708
  make: true,
9594
- dependenciesDiagnostics: true,
9595
9709
  inferAsyncModules: true,
9596
9710
  providedExports: true,
9711
+ dependenciesDiagnostics: true,
9712
+ sideEffects: true,
9597
9713
  buildChunkGraph: true,
9598
9714
  moduleIds: true,
9599
9715
  chunkIds: true,
@@ -9704,7 +9820,7 @@ var keyedNestedConfig = (value, fn2, customKeys) => {
9704
9820
  };
9705
9821
 
9706
9822
  // src/config/zod.ts
9707
- var import_node_path7 = __toESM(require("path"));
9823
+ var import_node_path8 = __toESM(require("path"));
9708
9824
  var import_zod2 = require("../compiled/zod/index.js");
9709
9825
 
9710
9826
  // src/config/utils.ts
@@ -9862,7 +9978,7 @@ var filename = filenameTemplate.or(
9862
9978
  var name = import_zod2.z.string();
9863
9979
  var dependencies = import_zod2.z.array(name);
9864
9980
  var context = import_zod2.z.string().refine(
9865
- (val) => import_node_path7.default.isAbsolute(val),
9981
+ (val) => import_node_path8.default.isAbsolute(val),
9866
9982
  (val) => ({
9867
9983
  message: `The provided value ${JSON.stringify(val)} must be an absolute path.`
9868
9984
  })
@@ -9961,7 +10077,7 @@ var entryDynamic = import_zod2.z.function().returns(
9961
10077
  entryStatic.or(import_zod2.z.promise(entryStatic))
9962
10078
  );
9963
10079
  var entry = entryStatic.or(entryDynamic);
9964
- var path6 = import_zod2.z.string();
10080
+ var path7 = import_zod2.z.string();
9965
10081
  var pathinfo = import_zod2.z.boolean().or(import_zod2.z.literal("verbose"));
9966
10082
  var assetModuleFilename = filename;
9967
10083
  var webassemblyModuleFilename = import_zod2.z.string();
@@ -10035,7 +10151,7 @@ var environment = import_zod2.z.strictObject({
10035
10151
  templateLiteral: import_zod2.z.boolean().optional()
10036
10152
  });
10037
10153
  var output = import_zod2.z.strictObject({
10038
- path: path6.optional(),
10154
+ path: path7.optional(),
10039
10155
  pathinfo: pathinfo.optional(),
10040
10156
  clean: clean.optional(),
10041
10157
  publicPath: publicPath.optional(),
@@ -10258,9 +10374,10 @@ var assetGeneratorDataUrlOptions = import_zod2.z.strictObject({
10258
10374
  mimetype: import_zod2.z.string().optional()
10259
10375
  });
10260
10376
  var assetGeneratorDataUrlFunction = import_zod2.z.function().args(
10377
+ import_zod2.z.instanceof(Buffer),
10261
10378
  import_zod2.z.strictObject({
10262
- content: import_zod2.z.string(),
10263
- filename: import_zod2.z.string()
10379
+ filename: import_zod2.z.string(),
10380
+ module: import_zod2.z.custom()
10264
10381
  })
10265
10382
  ).returns(import_zod2.z.string());
10266
10383
  var assetGeneratorDataUrl = assetGeneratorDataUrlOptions.or(
@@ -10499,6 +10616,8 @@ var externalItem = import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).o
10499
10616
  )
10500
10617
  ).or(
10501
10618
  import_zod2.z.function().args(externalItemFunctionData).returns(import_zod2.z.promise(externalItemValue))
10619
+ ).or(
10620
+ import_zod2.z.function().args(externalItemFunctionData).returns(externalItemValue)
10502
10621
  );
10503
10622
  var externals = externalItem.array().or(externalItem);
10504
10623
  var externalsPresets = import_zod2.z.strictObject({
@@ -10702,7 +10821,7 @@ var optimizationSplitChunksCacheGroup = import_zod2.z.strictObject({
10702
10821
  ).optional(),
10703
10822
  priority: import_zod2.z.number().optional(),
10704
10823
  enforce: import_zod2.z.boolean().optional(),
10705
- filename: import_zod2.z.string().optional(),
10824
+ filename: filename.optional(),
10706
10825
  reuseExistingChunk: import_zod2.z.boolean().optional(),
10707
10826
  type: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).optional(),
10708
10827
  idHint: import_zod2.z.string().optional(),
@@ -10723,7 +10842,7 @@ var optimizationSplitChunksOptions = import_zod2.z.strictObject({
10723
10842
  });
10724
10843
  var optimization = import_zod2.z.strictObject({
10725
10844
  moduleIds: import_zod2.z.enum(["named", "natural", "deterministic"]).optional(),
10726
- chunkIds: import_zod2.z.enum(["natural", "named", "deterministic"]).optional(),
10845
+ chunkIds: import_zod2.z.enum(["natural", "named", "deterministic", "size", "total-size"]).optional(),
10727
10846
  minimize: import_zod2.z.boolean().optional(),
10728
10847
  minimizer: import_zod2.z.literal("...").or(plugin).array().optional(),
10729
10848
  mergeDuplicateChunks: import_zod2.z.boolean().optional(),
@@ -10739,7 +10858,8 @@ var optimization = import_zod2.z.strictObject({
10739
10858
  usedExports: import_zod2.z.enum(["global"]).or(import_zod2.z.boolean()).optional(),
10740
10859
  mangleExports: import_zod2.z.enum(["size", "deterministic"]).or(import_zod2.z.boolean()).optional(),
10741
10860
  nodeEnv: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.literal(false)]).optional(),
10742
- emitOnErrors: import_zod2.z.boolean().optional()
10861
+ emitOnErrors: import_zod2.z.boolean().optional(),
10862
+ avoidEntryIife: import_zod2.z.boolean().optional()
10743
10863
  });
10744
10864
  var rspackFutureOptions = import_zod2.z.strictObject({
10745
10865
  bundlerInfo: import_zod2.z.strictObject({
@@ -10763,15 +10883,17 @@ var experimentCacheOptions = import_zod2.z.object({
10763
10883
  }).or(
10764
10884
  import_zod2.z.object({
10765
10885
  type: import_zod2.z.enum(["persistent"]),
10766
- snapshot: import_zod2.z.strictObject({
10767
- immutablePaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array(),
10768
- unmanagedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array(),
10769
- managedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array()
10770
- }),
10771
- storage: import_zod2.z.strictObject({
10886
+ buildDependencies: import_zod2.z.string().array().optional(),
10887
+ version: import_zod2.z.string().optional(),
10888
+ snapshot: import_zod2.z.object({
10889
+ immutablePaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional(),
10890
+ unmanagedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional(),
10891
+ managedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional()
10892
+ }).optional(),
10893
+ storage: import_zod2.z.object({
10772
10894
  type: import_zod2.z.enum(["filesystem"]),
10773
- directory: import_zod2.z.string()
10774
- })
10895
+ directory: import_zod2.z.string().optional()
10896
+ }).optional()
10775
10897
  })
10776
10898
  );
10777
10899
  var lazyCompilationOptions = import_zod2.z.object({
@@ -10789,6 +10911,7 @@ var incremental = import_zod2.z.strictObject({
10789
10911
  inferAsyncModules: import_zod2.z.boolean().optional(),
10790
10912
  providedExports: import_zod2.z.boolean().optional(),
10791
10913
  dependenciesDiagnostics: import_zod2.z.boolean().optional(),
10914
+ sideEffects: import_zod2.z.boolean().optional(),
10792
10915
  buildChunkGraph: import_zod2.z.boolean().optional(),
10793
10916
  moduleIds: import_zod2.z.boolean().optional(),
10794
10917
  chunkIds: import_zod2.z.boolean().optional(),
@@ -10829,198 +10952,43 @@ var amd = import_zod2.z.literal(false).or(import_zod2.z.record(import_zod2.z.any
10829
10952
  var bail = import_zod2.z.boolean();
10830
10953
  var performance = import_zod2.z.strictObject({
10831
10954
  assetFilter: import_zod2.z.function().args(import_zod2.z.string()).returns(import_zod2.z.boolean()).optional(),
10832
- hints: import_zod2.z.enum(["error", "warning"]).or(import_zod2.z.literal(false)).optional(),
10833
- maxAssetSize: import_zod2.z.number().optional(),
10834
- maxEntrypointSize: import_zod2.z.number().optional()
10835
- }).or(import_zod2.z.literal(false));
10836
- var rspackOptions = import_zod2.z.strictObject({
10837
- name: name.optional(),
10838
- dependencies: dependencies.optional(),
10839
- entry: entry.optional(),
10840
- output: output.optional(),
10841
- target: target.optional(),
10842
- mode: mode.optional(),
10843
- experiments: experiments.optional(),
10844
- externals: externals.optional(),
10845
- externalsType: externalsType.optional(),
10846
- externalsPresets: externalsPresets.optional(),
10847
- infrastructureLogging: infrastructureLogging.optional(),
10848
- cache: cacheOptions.optional(),
10849
- context: context.optional(),
10850
- devtool: devTool.optional(),
10851
- node: node.optional(),
10852
- loader: loader.optional(),
10853
- ignoreWarnings: ignoreWarnings.optional(),
10854
- watchOptions: watchOptions.optional(),
10855
- watch: watch.optional(),
10856
- stats: statsValue.optional(),
10857
- snapshot: snapshotOptions.optional(),
10858
- optimization: optimization.optional(),
10859
- resolve: resolveOptions.optional(),
10860
- resolveLoader: resolveOptions.optional(),
10861
- plugins: plugins.optional(),
10862
- devServer: devServer.optional(),
10863
- module: moduleOptions.optional(),
10864
- profile: profile.optional(),
10865
- amd: amd.optional(),
10866
- bail: bail.optional(),
10867
- performance: performance.optional()
10868
- });
10869
-
10870
- // src/builtin-plugin/EntryPlugin.ts
10871
- var EntryPlugin = create2(
10872
- import_binding24.BuiltinPluginName.EntryPlugin,
10873
- (context2, entry2, options = "") => {
10874
- const entryOptions = typeof options === "string" ? { name: options } : options;
10875
- return {
10876
- context: context2,
10877
- entry: entry2,
10878
- options: getRawEntryOptions(entryOptions)
10879
- };
10880
- },
10881
- "make"
10882
- );
10883
- function getRawEntryOptions(entry2) {
10884
- const runtime = entry2.runtime;
10885
- const chunkLoading2 = entry2.chunkLoading;
10886
- return {
10887
- name: entry2.name,
10888
- publicPath: entry2.publicPath,
10889
- baseUri: entry2.baseUri,
10890
- runtime,
10891
- chunkLoading: !isNil(chunkLoading2) ? getRawChunkLoading(chunkLoading2) : void 0,
10892
- asyncChunks: entry2.asyncChunks,
10893
- filename: entry2.filename,
10894
- library: entry2.library && getRawLibrary(entry2.library),
10895
- layer: entry2.layer ?? void 0,
10896
- dependOn: entry2.dependOn
10897
- };
10898
- }
10899
-
10900
- // src/builtin-plugin/DynamicEntryPlugin.ts
10901
- var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
10902
- constructor(context2, entry2) {
10903
- super();
10904
- this.context = context2;
10905
- this.entry = entry2;
10906
- this.name = import_binding25.BuiltinPluginName.DynamicEntryPlugin;
10907
- this.affectedHooks = "make";
10908
- }
10909
- raw(compiler) {
10910
- const raw = {
10911
- context: this.context,
10912
- entry: async () => {
10913
- const result2 = await this.entry();
10914
- return Object.entries(result2).map(([name2, desc]) => {
10915
- const options = EntryOptionPlugin_default.entryDescriptionToOptions(
10916
- compiler,
10917
- name2,
10918
- desc
10919
- );
10920
- return {
10921
- import: desc.import,
10922
- options: getRawEntryOptions(options)
10923
- };
10924
- });
10925
- }
10926
- };
10927
- return createBuiltinPlugin(this.name, raw);
10928
- }
10929
- };
10930
-
10931
- // src/builtin-plugin/ElectronTargetPlugin.ts
10932
- var import_binding26 = require("@rspack/binding");
10933
- var ElectronTargetPlugin = create2(
10934
- import_binding26.BuiltinPluginName.ElectronTargetPlugin,
10935
- (context2) => context2 ?? "none"
10936
- );
10937
-
10938
- // src/builtin-plugin/EnableChunkLoadingPlugin.ts
10939
- var import_binding27 = require("@rspack/binding");
10940
- var EnableChunkLoadingPlugin = create2(
10941
- import_binding27.BuiltinPluginName.EnableChunkLoadingPlugin,
10942
- (type) => type
10943
- );
10944
-
10945
- // src/builtin-plugin/EnableLibraryPlugin.ts
10946
- var import_binding28 = require("@rspack/binding");
10947
- var enabledTypes = /* @__PURE__ */ new WeakMap();
10948
- var getEnabledTypes = (compiler) => {
10949
- let set = enabledTypes.get(compiler);
10950
- if (set === void 0) {
10951
- set = /* @__PURE__ */ new Set();
10952
- enabledTypes.set(compiler, set);
10953
- }
10954
- return set;
10955
- };
10956
- var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
10957
- constructor(type) {
10958
- super();
10959
- this.type = type;
10960
- this.name = import_binding28.BuiltinPluginName.EnableLibraryPlugin;
10961
- }
10962
- static setEnabled(compiler, type) {
10963
- getEnabledTypes(compiler).add(type);
10964
- }
10965
- static checkEnabled(compiler, type) {
10966
- if (!getEnabledTypes(compiler).has(type)) {
10967
- throw new Error(
10968
- `Library type "${type}" is not enabled. EnableLibraryPlugin need to be used to enable this type of library. This usually happens through the "output.enabledLibraryTypes" option. If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". These types are enabled: ${Array.from(getEnabledTypes(compiler)).join(", ")}`
10969
- );
10970
- }
10971
- }
10972
- raw(compiler) {
10973
- const { type } = this;
10974
- const enabled = getEnabledTypes(compiler);
10975
- if (enabled.has(type)) return;
10976
- enabled.add(type);
10977
- return createBuiltinPlugin(this.name, type);
10978
- }
10979
- };
10980
-
10981
- // src/builtin-plugin/EnableWasmLoadingPlugin.ts
10982
- var import_binding29 = require("@rspack/binding");
10983
- var EnableWasmLoadingPlugin = create2(
10984
- import_binding29.BuiltinPluginName.EnableWasmLoadingPlugin,
10985
- (type) => type
10986
- );
10987
-
10988
- // src/builtin-plugin/EnsureChunkConditionsPlugin.ts
10989
- var import_binding30 = require("@rspack/binding");
10990
- var EnsureChunkConditionsPlugin = create2(
10991
- import_binding30.BuiltinPluginName.EnsureChunkConditionsPlugin,
10992
- () => {
10993
- }
10994
- );
10995
-
10996
- // src/builtin-plugin/EvalDevToolModulePlugin.ts
10997
- var import_binding31 = require("@rspack/binding");
10998
- var EvalDevToolModulePlugin = create2(
10999
- import_binding31.BuiltinPluginName.EvalDevToolModulePlugin,
11000
- (options) => options,
11001
- "compilation"
11002
- );
11003
-
11004
- // src/builtin-plugin/EvalSourceMapDevToolPlugin.ts
11005
- var import_binding32 = require("@rspack/binding");
11006
- var EvalSourceMapDevToolPlugin = create2(
11007
- import_binding32.BuiltinPluginName.EvalSourceMapDevToolPlugin,
11008
- (options) => {
11009
- return {
11010
- filename: options.filename || void 0,
11011
- append: options.append,
11012
- namespace: options.namespace ?? "",
11013
- columns: options.columns ?? true,
11014
- noSources: options.noSources ?? false,
11015
- publicPath: options.publicPath,
11016
- module: options.module
11017
- };
11018
- },
11019
- "compilation"
11020
- );
11021
-
11022
- // src/builtin-plugin/ExternalsPlugin.ts
11023
- var import_binding33 = require("@rspack/binding");
10955
+ hints: import_zod2.z.enum(["error", "warning"]).or(import_zod2.z.literal(false)).optional(),
10956
+ maxAssetSize: import_zod2.z.number().optional(),
10957
+ maxEntrypointSize: import_zod2.z.number().optional()
10958
+ }).or(import_zod2.z.literal(false));
10959
+ var rspackOptions = import_zod2.z.strictObject({
10960
+ name: name.optional(),
10961
+ dependencies: dependencies.optional(),
10962
+ entry: entry.optional(),
10963
+ output: output.optional(),
10964
+ target: target.optional(),
10965
+ mode: mode.optional(),
10966
+ experiments: experiments.optional(),
10967
+ externals: externals.optional(),
10968
+ externalsType: externalsType.optional(),
10969
+ externalsPresets: externalsPresets.optional(),
10970
+ infrastructureLogging: infrastructureLogging.optional(),
10971
+ cache: cacheOptions.optional(),
10972
+ context: context.optional(),
10973
+ devtool: devTool.optional(),
10974
+ node: node.optional(),
10975
+ loader: loader.optional(),
10976
+ ignoreWarnings: ignoreWarnings.optional(),
10977
+ watchOptions: watchOptions.optional(),
10978
+ watch: watch.optional(),
10979
+ stats: statsValue.optional(),
10980
+ snapshot: snapshotOptions.optional(),
10981
+ optimization: optimization.optional(),
10982
+ resolve: resolveOptions.optional(),
10983
+ resolveLoader: resolveOptions.optional(),
10984
+ plugins: plugins.optional(),
10985
+ devServer: devServer.optional(),
10986
+ module: moduleOptions.optional(),
10987
+ profile: profile.optional(),
10988
+ amd: amd.optional(),
10989
+ bail: bail.optional(),
10990
+ performance: performance.optional()
10991
+ });
11024
10992
 
11025
10993
  // src/Resolver.ts
11026
10994
  function isString(value) {
@@ -11030,12 +10998,12 @@ var Resolver = class _Resolver {
11030
10998
  constructor(binding3) {
11031
10999
  this.binding = binding3;
11032
11000
  }
11033
- resolveSync(context2, path10, request) {
11034
- return this.binding.resolveSync(path10, request);
11001
+ resolveSync(context2, path11, request) {
11002
+ return this.binding.resolveSync(path11, request);
11035
11003
  }
11036
- resolve(context2, path10, request, resolveContext, callback) {
11004
+ resolve(context2, path11, request, resolveContext, callback) {
11037
11005
  try {
11038
- const res = this.binding.resolveSync(path10, request);
11006
+ const res = this.binding.resolveSync(path11, request);
11039
11007
  callback(null, res);
11040
11008
  } catch (err) {
11041
11009
  callback(err);
@@ -11065,7 +11033,7 @@ var ExternalsPlugin = class extends RspackBuiltinPlugin {
11065
11033
  super();
11066
11034
  this.type = type;
11067
11035
  this.externals = externals2;
11068
- this.name = import_binding33.BuiltinPluginName.ExternalsPlugin;
11036
+ this.name = import_binding28.BuiltinPluginName.ExternalsPlugin;
11069
11037
  }
11070
11038
  raw(compiler) {
11071
11039
  const { type, externals: externals2 } = this;
@@ -11149,6 +11117,13 @@ function getRawExternalItem(compiler, item) {
11149
11117
  }),
11150
11118
  (e) => reject(e)
11151
11119
  );
11120
+ } else if (item.length === 1) {
11121
+ resolve2({
11122
+ result: getRawExternalItemValueFormFnResult(
11123
+ promise
11124
+ ),
11125
+ externalType: void 0
11126
+ });
11152
11127
  }
11153
11128
  });
11154
11129
  };
@@ -11173,30 +11148,30 @@ function getRawExternalItemValue(value) {
11173
11148
  }
11174
11149
 
11175
11150
  // src/builtin-plugin/FileUriPlugin.ts
11176
- var import_binding34 = require("@rspack/binding");
11151
+ var import_binding29 = require("@rspack/binding");
11177
11152
  var FileUriPlugin = create2(
11178
- import_binding34.BuiltinPluginName.FileUriPlugin,
11153
+ import_binding29.BuiltinPluginName.FileUriPlugin,
11179
11154
  () => {
11180
11155
  },
11181
11156
  "compilation"
11182
11157
  );
11183
11158
 
11184
11159
  // src/builtin-plugin/FlagDependencyExportsPlugin.ts
11185
- var import_binding35 = require("@rspack/binding");
11160
+ var import_binding30 = require("@rspack/binding");
11186
11161
  var FlagDependencyExportsPlugin = create2(
11187
- import_binding35.BuiltinPluginName.FlagDependencyExportsPlugin,
11162
+ import_binding30.BuiltinPluginName.FlagDependencyExportsPlugin,
11188
11163
  () => {
11189
11164
  },
11190
11165
  "compilation"
11191
11166
  );
11192
11167
 
11193
11168
  // src/builtin-plugin/FlagDependencyUsagePlugin.ts
11194
- var import_binding36 = require("@rspack/binding");
11169
+ var import_binding31 = require("@rspack/binding");
11195
11170
  var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
11196
11171
  constructor(global) {
11197
11172
  super();
11198
11173
  this.global = global;
11199
- this.name = import_binding36.BuiltinPluginName.FlagDependencyUsagePlugin;
11174
+ this.name = import_binding31.BuiltinPluginName.FlagDependencyUsagePlugin;
11200
11175
  this.affectedHooks = "compilation";
11201
11176
  }
11202
11177
  raw(compiler) {
@@ -11207,19 +11182,19 @@ var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
11207
11182
  if (incremental2.modulesHashes) {
11208
11183
  incremental2.modulesHashes = false;
11209
11184
  logger.warn(
11210
- "`optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false."
11185
+ "`optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
11211
11186
  );
11212
11187
  }
11213
11188
  if (incremental2.modulesCodegen) {
11214
11189
  incremental2.modulesCodegen = false;
11215
11190
  logger.warn(
11216
- "`optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false."
11191
+ "`optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
11217
11192
  );
11218
11193
  }
11219
11194
  if (incremental2.modulesRuntimeRequirements) {
11220
11195
  incremental2.modulesRuntimeRequirements = false;
11221
11196
  logger.warn(
11222
- "`optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
11197
+ "`optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
11223
11198
  );
11224
11199
  }
11225
11200
  return createBuiltinPlugin(this.name, this.global);
@@ -11227,11 +11202,11 @@ var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
11227
11202
  };
11228
11203
 
11229
11204
  // src/builtin-plugin/HotModuleReplacementPlugin.ts
11230
- var import_binding37 = require("@rspack/binding");
11205
+ var import_binding32 = require("@rspack/binding");
11231
11206
  var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
11232
11207
  constructor() {
11233
11208
  super(...arguments);
11234
- this.name = import_binding37.BuiltinPluginName.HotModuleReplacementPlugin;
11209
+ this.name = import_binding32.BuiltinPluginName.HotModuleReplacementPlugin;
11235
11210
  }
11236
11211
  raw(compiler) {
11237
11212
  if (compiler.options.output.strictModuleErrorHandling === void 0) {
@@ -11243,8 +11218,8 @@ var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
11243
11218
 
11244
11219
  // src/builtin-plugin/HtmlRspackPlugin.ts
11245
11220
  var import_node_fs2 = __toESM(require("fs"));
11246
- var import_node_path8 = __toESM(require("path"));
11247
- var import_binding38 = require("@rspack/binding");
11221
+ var import_node_path9 = __toESM(require("path"));
11222
+ var import_binding33 = require("@rspack/binding");
11248
11223
  var liteTapable3 = __toESM(require("@rspack/lite-tapable"));
11249
11224
  var import_zod3 = require("../compiled/zod/index.js");
11250
11225
 
@@ -11279,11 +11254,11 @@ function isNonEmptyArray(value) {
11279
11254
  return value.length !== 0;
11280
11255
  }
11281
11256
  var identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
11282
- function joinPath(path10) {
11283
- if (path10.length === 1) {
11284
- return path10[0].toString();
11257
+ function joinPath(path11) {
11258
+ if (path11.length === 1) {
11259
+ return path11[0].toString();
11285
11260
  }
11286
- return path10.reduce((acc, item) => {
11261
+ return path11.reduce((acc, item) => {
11287
11262
  if (typeof item === "number") {
11288
11263
  return acc + "[" + item.toString() + "]";
11289
11264
  }
@@ -11534,7 +11509,7 @@ var htmlRspackPluginOptions = import_zod3.z.strictObject({
11534
11509
  hash: import_zod3.z.boolean().optional()
11535
11510
  });
11536
11511
  var HtmlRspackPluginImpl = create2(
11537
- import_binding38.BuiltinPluginName.HtmlRspackPlugin,
11512
+ import_binding33.BuiltinPluginName.HtmlRspackPlugin,
11538
11513
  function(c = {}) {
11539
11514
  validate(c, htmlRspackPluginOptions);
11540
11515
  const meta = {};
@@ -11613,10 +11588,10 @@ var HtmlRspackPluginImpl = create2(
11613
11588
  templateContent = "";
11614
11589
  } else if (c.template) {
11615
11590
  const filename2 = c.template.split("?")[0];
11616
- if ([".js", ".cjs"].includes(import_node_path8.default.extname(filename2))) {
11591
+ if ([".js", ".cjs"].includes(import_node_path9.default.extname(filename2))) {
11617
11592
  templateFn = async (data) => {
11618
11593
  const context2 = this.options.context || process.cwd();
11619
- const templateFilePath = import_node_path8.default.resolve(context2, filename2);
11594
+ const templateFilePath = import_node_path9.default.resolve(context2, filename2);
11620
11595
  if (!import_node_fs2.default.existsSync(templateFilePath)) {
11621
11596
  throw new Error(
11622
11597
  `HtmlRspackPlugin: could not load file \`${filename2}\` from \`${context2}\``
@@ -11773,9 +11748,9 @@ HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = (compilation)
11773
11748
  HtmlRspackPlugin.version = 5;
11774
11749
 
11775
11750
  // src/builtin-plugin/HttpExternalsRspackPlugin.ts
11776
- var import_binding39 = require("@rspack/binding");
11751
+ var import_binding34 = require("@rspack/binding");
11777
11752
  var HttpExternalsRspackPlugin = create2(
11778
- import_binding39.BuiltinPluginName.HttpExternalsRspackPlugin,
11753
+ import_binding34.BuiltinPluginName.HttpExternalsRspackPlugin,
11779
11754
  (css, webAsync) => {
11780
11755
  return {
11781
11756
  css,
@@ -11785,7 +11760,7 @@ var HttpExternalsRspackPlugin = create2(
11785
11760
  );
11786
11761
 
11787
11762
  // src/builtin-plugin/IgnorePlugin.ts
11788
- var import_binding40 = require("@rspack/binding");
11763
+ var import_binding35 = require("@rspack/binding");
11789
11764
  var import_zod4 = require("../compiled/zod/index.js");
11790
11765
  var IgnorePluginOptions = import_zod4.z.union([
11791
11766
  import_zod4.z.object({
@@ -11797,7 +11772,7 @@ var IgnorePluginOptions = import_zod4.z.union([
11797
11772
  })
11798
11773
  ]);
11799
11774
  var IgnorePlugin = create2(
11800
- import_binding40.BuiltinPluginName.IgnorePlugin,
11775
+ import_binding35.BuiltinPluginName.IgnorePlugin,
11801
11776
  (options) => {
11802
11777
  validate(options, IgnorePluginOptions);
11803
11778
  return options;
@@ -11805,22 +11780,22 @@ var IgnorePlugin = create2(
11805
11780
  );
11806
11781
 
11807
11782
  // src/builtin-plugin/InferAsyncModulesPlugin.ts
11808
- var import_binding41 = require("@rspack/binding");
11783
+ var import_binding36 = require("@rspack/binding");
11809
11784
  var InferAsyncModulesPlugin = create2(
11810
- import_binding41.BuiltinPluginName.InferAsyncModulesPlugin,
11785
+ import_binding36.BuiltinPluginName.InferAsyncModulesPlugin,
11811
11786
  () => {
11812
11787
  },
11813
11788
  "compilation"
11814
11789
  );
11815
11790
 
11816
11791
  // src/builtin-plugin/JavascriptModulesPlugin.ts
11817
- var import_binding42 = require("@rspack/binding");
11792
+ var import_binding37 = require("@rspack/binding");
11818
11793
  var liteTapable4 = __toESM(require("@rspack/lite-tapable"));
11819
11794
  var compilationHooksMap3 = /* @__PURE__ */ new WeakMap();
11820
11795
  var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
11821
11796
  constructor() {
11822
11797
  super(...arguments);
11823
- this.name = import_binding42.BuiltinPluginName.JavascriptModulesPlugin;
11798
+ this.name = import_binding37.BuiltinPluginName.JavascriptModulesPlugin;
11824
11799
  this.affectedHooks = "compilation";
11825
11800
  }
11826
11801
  raw() {
@@ -11844,18 +11819,18 @@ var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
11844
11819
  };
11845
11820
 
11846
11821
  // src/builtin-plugin/JsLoaderRspackPlugin.ts
11847
- var import_binding43 = require("@rspack/binding");
11822
+ var import_binding38 = require("@rspack/binding");
11848
11823
  var JsLoaderRspackPlugin = create2(
11849
- import_binding43.BuiltinPluginName.JsLoaderRspackPlugin,
11824
+ import_binding38.BuiltinPluginName.JsLoaderRspackPlugin,
11850
11825
  (compiler) => runLoaders.bind(null, compiler),
11851
11826
  /* Not Inheretable */
11852
11827
  "thisCompilation"
11853
11828
  );
11854
11829
 
11855
11830
  // src/builtin-plugin/JsonModulesPlugin.ts
11856
- var import_binding44 = require("@rspack/binding");
11831
+ var import_binding39 = require("@rspack/binding");
11857
11832
  var JsonModulesPlugin = create2(
11858
- import_binding44.BuiltinPluginName.JsonModulesPlugin,
11833
+ import_binding39.BuiltinPluginName.JsonModulesPlugin,
11859
11834
  () => {
11860
11835
  },
11861
11836
  "compilation"
@@ -11953,12 +11928,12 @@ var getBackend = (options) => (compiler, callback) => {
11953
11928
  },
11954
11929
  module({
11955
11930
  module: originalModule,
11956
- path: path10
11931
+ path: path11
11957
11932
  }) {
11958
11933
  const key = `${encodeURIComponent(
11959
11934
  originalModule.replace(/\\/g, "/").replace(/@/g, "_")
11960
11935
  ).replace(/%(2F|3A|24|26|2B|2C|3B|3D|3A)/g, decodeURIComponent)}`;
11961
- filesByKey.set(key, path10);
11936
+ filesByKey.set(key, path11);
11962
11937
  const active = activeModules.get(key) > 0;
11963
11938
  return {
11964
11939
  client: `${options.client}?${encodeURIComponent(urlBase + prefix)}`,
@@ -11991,9 +11966,9 @@ function moduleImpl(args) {
11991
11966
  }
11992
11967
 
11993
11968
  // src/builtin-plugin/lazy-compilation/lazyCompilation.ts
11994
- var import_binding45 = require("@rspack/binding");
11969
+ var import_binding40 = require("@rspack/binding");
11995
11970
  var BuiltinLazyCompilationPlugin = create2(
11996
- import_binding45.BuiltinPluginName.LazyCompilationPlugin,
11971
+ import_binding40.BuiltinPluginName.LazyCompilationPlugin,
11997
11972
  (module2, cacheable, entries, imports, test) => ({ module: module2, cacheable, imports, entries, test }),
11998
11973
  "thisCompilation"
11999
11974
  );
@@ -12009,8 +11984,8 @@ var LazyCompilationPlugin = class {
12009
11984
  }
12010
11985
  apply(compiler) {
12011
11986
  const backend = backend_default({
12012
- ...this.backend,
12013
- client: require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`)
11987
+ client: require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`),
11988
+ ...this.backend
12014
11989
  });
12015
11990
  new BuiltinLazyCompilationPlugin(
12016
11991
  moduleImpl,
@@ -12038,21 +12013,21 @@ var LazyCompilationPlugin = class {
12038
12013
  };
12039
12014
 
12040
12015
  // src/builtin-plugin/LimitChunkCountPlugin.ts
12041
- var import_binding46 = require("@rspack/binding");
12016
+ var import_binding41 = require("@rspack/binding");
12042
12017
  var LimitChunkCountPlugin = create2(
12043
- import_binding46.BuiltinPluginName.LimitChunkCountPlugin,
12018
+ import_binding41.BuiltinPluginName.LimitChunkCountPlugin,
12044
12019
  (options) => {
12045
12020
  return options;
12046
12021
  }
12047
12022
  );
12048
12023
 
12049
12024
  // src/builtin-plugin/MangleExportsPlugin.ts
12050
- var import_binding47 = require("@rspack/binding");
12025
+ var import_binding42 = require("@rspack/binding");
12051
12026
  var MangleExportsPlugin = class extends RspackBuiltinPlugin {
12052
12027
  constructor(deterministic) {
12053
12028
  super();
12054
12029
  this.deterministic = deterministic;
12055
- this.name = import_binding47.BuiltinPluginName.MangleExportsPlugin;
12030
+ this.name = import_binding42.BuiltinPluginName.MangleExportsPlugin;
12056
12031
  this.affectedHooks = "compilation";
12057
12032
  }
12058
12033
  raw(compiler) {
@@ -12063,19 +12038,19 @@ var MangleExportsPlugin = class extends RspackBuiltinPlugin {
12063
12038
  if (incremental2.modulesHashes) {
12064
12039
  incremental2.modulesHashes = false;
12065
12040
  logger.warn(
12066
- "`optimization.mangleExports` can't be used with `incremental.modulesHashes` as export mangling is a global effect. `incremental.modulesHashes` has been overridden to false."
12041
+ "`optimization.mangleExports` can't be used with `incremental.modulesHashes` as export mangling is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
12067
12042
  );
12068
12043
  }
12069
12044
  if (incremental2.modulesCodegen) {
12070
12045
  incremental2.modulesCodegen = false;
12071
12046
  logger.warn(
12072
- "`optimization.mangleExports` can't be used with `incremental.modulesCodegen` as export mangling is a global effect. `incremental.modulesCodegen` has been overridden to false."
12047
+ "`optimization.mangleExports` can't be used with `incremental.modulesCodegen` as export mangling is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
12073
12048
  );
12074
12049
  }
12075
12050
  if (incremental2.modulesRuntimeRequirements) {
12076
12051
  incremental2.modulesRuntimeRequirements = false;
12077
12052
  logger.warn(
12078
- "`optimization.mangleExports` can't be used with `incremental.modulesRuntimeRequirements` as export mangling is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
12053
+ "`optimization.mangleExports` can't be used with `incremental.modulesRuntimeRequirements` as export mangling is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
12079
12054
  );
12080
12055
  }
12081
12056
  return createBuiltinPlugin(this.name, this.deterministic);
@@ -12083,27 +12058,27 @@ var MangleExportsPlugin = class extends RspackBuiltinPlugin {
12083
12058
  };
12084
12059
 
12085
12060
  // src/builtin-plugin/MergeDuplicateChunksPlugin.ts
12086
- var import_binding48 = require("@rspack/binding");
12061
+ var import_binding43 = require("@rspack/binding");
12087
12062
  var MergeDuplicateChunksPlugin = create2(
12088
- import_binding48.BuiltinPluginName.MergeDuplicateChunksPlugin,
12063
+ import_binding43.BuiltinPluginName.MergeDuplicateChunksPlugin,
12089
12064
  () => {
12090
12065
  }
12091
12066
  );
12092
12067
 
12093
12068
  // src/builtin-plugin/ModuleChunkFormatPlugin.ts
12094
- var import_binding49 = require("@rspack/binding");
12069
+ var import_binding44 = require("@rspack/binding");
12095
12070
  var ModuleChunkFormatPlugin = create2(
12096
- import_binding49.BuiltinPluginName.ModuleChunkFormatPlugin,
12071
+ import_binding44.BuiltinPluginName.ModuleChunkFormatPlugin,
12097
12072
  () => {
12098
12073
  }
12099
12074
  );
12100
12075
 
12101
12076
  // src/builtin-plugin/ModuleConcatenationPlugin.ts
12102
- var import_binding50 = require("@rspack/binding");
12077
+ var import_binding45 = require("@rspack/binding");
12103
12078
  var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
12104
12079
  constructor() {
12105
12080
  super(...arguments);
12106
- this.name = import_binding50.BuiltinPluginName.ModuleConcatenationPlugin;
12081
+ this.name = import_binding45.BuiltinPluginName.ModuleConcatenationPlugin;
12107
12082
  this.affectedHooks = "compilation";
12108
12083
  }
12109
12084
  raw(compiler) {
@@ -12114,43 +12089,43 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
12114
12089
  if (incremental2.moduleIds) {
12115
12090
  incremental2.moduleIds = false;
12116
12091
  logger.warn(
12117
- "`optimization.concatenateModules` can't be used with `incremental.moduleIds` as module concatenation is a global effect. `incremental.moduleIds` has been overridden to false."
12092
+ "`optimization.concatenateModules` can't be used with `incremental.moduleIds` as module concatenation is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
12118
12093
  );
12119
12094
  }
12120
12095
  if (incremental2.modulesHashes) {
12121
12096
  incremental2.modulesHashes = false;
12122
12097
  logger.warn(
12123
- "`optimization.concatenateModules` can't be used with `incremental.modulesHashes` as module concatenation is a global effect. `incremental.modulesHashes` has been overridden to false."
12098
+ "`optimization.concatenateModules` can't be used with `incremental.modulesHashes` as module concatenation is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
12124
12099
  );
12125
12100
  }
12126
12101
  if (incremental2.modulesCodegen) {
12127
12102
  incremental2.modulesCodegen = false;
12128
12103
  logger.warn(
12129
- "`optimization.concatenateModules` can't be used with `incremental.modulesCodegen` as module concatenation is a global effect. `incremental.modulesCodegen` has been overridden to false."
12104
+ "`optimization.concatenateModules` can't be used with `incremental.modulesCodegen` as module concatenation is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
12130
12105
  );
12131
12106
  }
12132
12107
  if (incremental2.modulesRuntimeRequirements) {
12133
12108
  incremental2.modulesRuntimeRequirements = false;
12134
12109
  logger.warn(
12135
- "`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
12110
+ "`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
12136
12111
  );
12137
12112
  }
12138
12113
  if (incremental2.chunksRuntimeRequirements) {
12139
12114
  incremental2.chunksRuntimeRequirements = false;
12140
12115
  logger.warn(
12141
- "`optimization.concatenateModules` can't be used with `incremental.chunksRuntimeRequirements` as module concatenation is a global effect. `incremental.chunksRuntimeRequirements` has been overridden to false."
12116
+ "`optimization.concatenateModules` can't be used with `incremental.chunksRuntimeRequirements` as module concatenation is a global effect. `incremental.chunksRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
12142
12117
  );
12143
12118
  }
12144
12119
  if (incremental2.chunksHashes) {
12145
12120
  incremental2.chunksHashes = false;
12146
12121
  logger.warn(
12147
- "`optimization.concatenateModules` can't be used with `incremental.chunksHashes` as module concatenation is a global effect. `incremental.chunksHashes` has been overridden to false."
12122
+ "`optimization.concatenateModules` can't be used with `incremental.chunksHashes` as module concatenation is a global effect. `incremental.chunksHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
12148
12123
  );
12149
12124
  }
12150
12125
  if (incremental2.chunksRender) {
12151
12126
  incremental2.chunksRender = false;
12152
12127
  logger.warn(
12153
- "`optimization.concatenateModules` can't be used with `incremental.chunksRender` as module concatenation is a global effect. `incremental.chunksRender` has been overridden to false."
12128
+ "`optimization.concatenateModules` can't be used with `incremental.chunksRender` as module concatenation is a global effect. `incremental.chunksRender` has been overridden to false. We recommend enabling incremental only in the development mode."
12154
12129
  );
12155
12130
  }
12156
12131
  return createBuiltinPlugin(this.name, void 0);
@@ -12158,38 +12133,52 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
12158
12133
  };
12159
12134
 
12160
12135
  // src/builtin-plugin/NamedChunkIdsPlugin.ts
12161
- var import_binding51 = require("@rspack/binding");
12136
+ var import_binding46 = require("@rspack/binding");
12162
12137
  var NamedChunkIdsPlugin = create2(
12163
- import_binding51.BuiltinPluginName.NamedChunkIdsPlugin,
12138
+ import_binding46.BuiltinPluginName.NamedChunkIdsPlugin,
12164
12139
  () => {
12165
12140
  },
12166
12141
  "compilation"
12167
12142
  );
12168
12143
 
12169
12144
  // src/builtin-plugin/NamedModuleIdsPlugin.ts
12170
- var import_binding52 = require("@rspack/binding");
12145
+ var import_binding47 = require("@rspack/binding");
12171
12146
  var NamedModuleIdsPlugin = create2(
12172
- import_binding52.BuiltinPluginName.NamedModuleIdsPlugin,
12147
+ import_binding47.BuiltinPluginName.NamedModuleIdsPlugin,
12173
12148
  () => {
12174
12149
  },
12175
12150
  "compilation"
12176
12151
  );
12177
12152
 
12178
12153
  // src/builtin-plugin/NaturalChunkIdsPlugin.ts
12179
- var import_binding53 = require("@rspack/binding");
12180
- var NaturalChunkIdsPlugin = create2(
12181
- import_binding53.BuiltinPluginName.NaturalChunkIdsPlugin,
12182
- () => {
12183
- },
12184
- "compilation"
12185
- );
12154
+ var import_binding48 = require("@rspack/binding");
12155
+ var NaturalChunkIdsPlugin = class extends RspackBuiltinPlugin {
12156
+ constructor() {
12157
+ super(...arguments);
12158
+ this.name = import_binding48.BuiltinPluginName.NaturalChunkIdsPlugin;
12159
+ this.affectedHooks = "compilation";
12160
+ }
12161
+ raw(compiler) {
12162
+ const incremental2 = compiler.options.experiments.incremental;
12163
+ const logger = compiler.getInfrastructureLogger(
12164
+ "rspack.NaturalChunkIdsPlugin"
12165
+ );
12166
+ if (incremental2.moduleIds) {
12167
+ incremental2.moduleIds = false;
12168
+ logger.warn(
12169
+ "`optimization.chunkIds = 'natural'` can't be used with `incremental.chunkIds` as natural chunk ids is a global effect. `incremental.chunkIds` has been overridden to false. We recommend enabling incremental only in the development mode."
12170
+ );
12171
+ }
12172
+ return createBuiltinPlugin(this.name, void 0);
12173
+ }
12174
+ };
12186
12175
 
12187
12176
  // src/builtin-plugin/NaturalModuleIdsPlugin.ts
12188
- var import_binding54 = require("@rspack/binding");
12177
+ var import_binding49 = require("@rspack/binding");
12189
12178
  var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
12190
12179
  constructor() {
12191
12180
  super(...arguments);
12192
- this.name = import_binding54.BuiltinPluginName.NaturalModuleIdsPlugin;
12181
+ this.name = import_binding49.BuiltinPluginName.NaturalModuleIdsPlugin;
12193
12182
  this.affectedHooks = "compilation";
12194
12183
  }
12195
12184
  raw(compiler) {
@@ -12200,7 +12189,7 @@ var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
12200
12189
  if (incremental2.moduleIds) {
12201
12190
  incremental2.moduleIds = false;
12202
12191
  logger.warn(
12203
- "`optimization.moduleIds = 'natural'` can't be used with `incremental.moduleIds` as natural module ids is a global effect. `incremental.moduleIds` has been overridden to false."
12192
+ "`optimization.moduleIds = 'natural'` can't be used with `incremental.moduleIds` as natural module ids is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
12204
12193
  );
12205
12194
  }
12206
12195
  return createBuiltinPlugin(this.name, void 0);
@@ -12208,16 +12197,24 @@ var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
12208
12197
  };
12209
12198
 
12210
12199
  // src/builtin-plugin/NodeTargetPlugin.ts
12211
- var import_binding55 = require("@rspack/binding");
12200
+ var import_binding50 = require("@rspack/binding");
12212
12201
  var NodeTargetPlugin = create2(
12213
- import_binding55.BuiltinPluginName.NodeTargetPlugin,
12202
+ import_binding50.BuiltinPluginName.NodeTargetPlugin,
12214
12203
  () => void 0
12215
12204
  );
12216
12205
 
12206
+ // src/builtin-plugin/OccurrenceChunkIdsPlugin.ts
12207
+ var import_binding51 = require("@rspack/binding");
12208
+ var OccurrenceChunkIdsPlugin = create2(
12209
+ import_binding51.BuiltinPluginName.OccurrenceChunkIdsPlugin,
12210
+ (options) => ({ ...options }),
12211
+ "compilation"
12212
+ );
12213
+
12217
12214
  // src/builtin-plugin/ProgressPlugin.ts
12218
- var import_binding56 = require("@rspack/binding");
12215
+ var import_binding52 = require("@rspack/binding");
12219
12216
  var ProgressPlugin = create2(
12220
- import_binding56.BuiltinPluginName.ProgressPlugin,
12217
+ import_binding52.BuiltinPluginName.ProgressPlugin,
12221
12218
  (progress = {}) => {
12222
12219
  if (typeof progress === "function") {
12223
12220
  return {
@@ -12231,9 +12228,9 @@ var ProgressPlugin = create2(
12231
12228
  );
12232
12229
 
12233
12230
  // src/builtin-plugin/ProvidePlugin.ts
12234
- var import_binding57 = require("@rspack/binding");
12231
+ var import_binding53 = require("@rspack/binding");
12235
12232
  var ProvidePlugin = create2(
12236
- import_binding57.BuiltinPluginName.ProvidePlugin,
12233
+ import_binding53.BuiltinPluginName.ProvidePlugin,
12237
12234
  (provide) => {
12238
12235
  const entries = Object.entries(provide).map(([key, value]) => {
12239
12236
  if (typeof value === "string") {
@@ -12247,53 +12244,53 @@ var ProvidePlugin = create2(
12247
12244
  );
12248
12245
 
12249
12246
  // src/builtin-plugin/RealContentHashPlugin.ts
12250
- var import_binding58 = require("@rspack/binding");
12247
+ var import_binding54 = require("@rspack/binding");
12251
12248
  var RealContentHashPlugin = create2(
12252
- import_binding58.BuiltinPluginName.RealContentHashPlugin,
12249
+ import_binding54.BuiltinPluginName.RealContentHashPlugin,
12253
12250
  () => {
12254
12251
  },
12255
12252
  "compilation"
12256
12253
  );
12257
12254
 
12258
12255
  // src/builtin-plugin/RemoveEmptyChunksPlugin.ts
12259
- var import_binding59 = require("@rspack/binding");
12256
+ var import_binding55 = require("@rspack/binding");
12260
12257
  var RemoveEmptyChunksPlugin = create2(
12261
- import_binding59.BuiltinPluginName.RemoveEmptyChunksPlugin,
12258
+ import_binding55.BuiltinPluginName.RemoveEmptyChunksPlugin,
12262
12259
  () => {
12263
12260
  },
12264
12261
  "compilation"
12265
12262
  );
12266
12263
 
12267
12264
  // src/builtin-plugin/RuntimeChunkPlugin.ts
12268
- var import_binding60 = require("@rspack/binding");
12265
+ var import_binding56 = require("@rspack/binding");
12269
12266
  var RuntimeChunkPlugin = create2(
12270
- import_binding60.BuiltinPluginName.RuntimeChunkPlugin,
12267
+ import_binding56.BuiltinPluginName.RuntimeChunkPlugin,
12271
12268
  (options) => options,
12272
12269
  "thisCompilation"
12273
12270
  );
12274
12271
 
12275
12272
  // src/builtin-plugin/RuntimePlugin.ts
12276
- var import_binding61 = require("@rspack/binding");
12273
+ var import_binding57 = require("@rspack/binding");
12277
12274
  var RuntimePlugin = create2(
12278
- import_binding61.BuiltinPluginName.RuntimePlugin,
12275
+ import_binding57.BuiltinPluginName.RuntimePlugin,
12279
12276
  () => {
12280
12277
  },
12281
12278
  "compilation"
12282
12279
  );
12283
12280
 
12284
12281
  // src/builtin-plugin/SideEffectsFlagPlugin.ts
12285
- var import_binding62 = require("@rspack/binding");
12282
+ var import_binding58 = require("@rspack/binding");
12286
12283
  var SideEffectsFlagPlugin = create2(
12287
- import_binding62.BuiltinPluginName.SideEffectsFlagPlugin,
12284
+ import_binding58.BuiltinPluginName.SideEffectsFlagPlugin,
12288
12285
  () => {
12289
12286
  },
12290
12287
  "compilation"
12291
12288
  );
12292
12289
 
12293
12290
  // src/builtin-plugin/SizeLimitsPlugin.ts
12294
- var import_binding63 = require("@rspack/binding");
12291
+ var import_binding59 = require("@rspack/binding");
12295
12292
  var SizeLimitsPlugin = create2(
12296
- import_binding63.BuiltinPluginName.SizeLimitsPlugin,
12293
+ import_binding59.BuiltinPluginName.SizeLimitsPlugin,
12297
12294
  (options) => {
12298
12295
  const hints = options.hints === false ? void 0 : options.hints;
12299
12296
  return { ...options, hints };
@@ -12301,16 +12298,16 @@ var SizeLimitsPlugin = create2(
12301
12298
  );
12302
12299
 
12303
12300
  // src/builtin-plugin/SourceMapDevToolPlugin.ts
12304
- var import_binding64 = require("@rspack/binding");
12301
+ var import_binding60 = require("@rspack/binding");
12305
12302
  var SourceMapDevToolPlugin = create2(
12306
- import_binding64.BuiltinPluginName.SourceMapDevToolPlugin,
12303
+ import_binding60.BuiltinPluginName.SourceMapDevToolPlugin,
12307
12304
  (options) => options,
12308
12305
  "compilation"
12309
12306
  );
12310
12307
 
12311
12308
  // src/builtin-plugin/SplitChunksPlugin.ts
12312
12309
  var import_node_assert5 = __toESM(require("assert"));
12313
- var import_binding65 = require("@rspack/binding");
12310
+ var import_binding61 = require("@rspack/binding");
12314
12311
 
12315
12312
  // src/util/SplitChunkSize.ts
12316
12313
  var JsSplitChunkSizes = class {
@@ -12333,7 +12330,7 @@ var SplitChunksPlugin = class extends RspackBuiltinPlugin {
12333
12330
  constructor(options) {
12334
12331
  super();
12335
12332
  this.options = options;
12336
- this.name = import_binding65.BuiltinPluginName.SplitChunksPlugin;
12333
+ this.name = import_binding61.BuiltinPluginName.SplitChunksPlugin;
12337
12334
  this.affectedHooks = "thisCompilation";
12338
12335
  }
12339
12336
  raw(compiler) {
@@ -12353,7 +12350,7 @@ function toRawSplitChunksOptions(sc, compiler) {
12353
12350
  return name3(void 0);
12354
12351
  }
12355
12352
  return name3(
12356
- Module.__from_binding(ctx.module, compiler._lastCompilation),
12353
+ Module.__from_binding(ctx.module),
12357
12354
  getChunks(ctx.chunks),
12358
12355
  ctx.cacheGroupKey
12359
12356
  );
@@ -12367,21 +12364,14 @@ function toRawSplitChunksOptions(sc, compiler) {
12367
12364
  if (typeof ctx.module === "undefined") {
12368
12365
  return test(void 0);
12369
12366
  }
12370
- return test(
12371
- Module.__from_binding(ctx.module, compiler._lastCompilation)
12372
- );
12367
+ return test(Module.__from_binding(ctx.module));
12373
12368
  };
12374
12369
  }
12375
12370
  return test;
12376
12371
  }
12377
12372
  function getChunks(chunks2) {
12378
12373
  if (typeof chunks2 === "function") {
12379
- return (chunk) => chunks2(
12380
- Chunk.__from_binding(
12381
- chunk,
12382
- compiler._lastCompilation.__internal_getInner()
12383
- )
12384
- );
12374
+ return (chunk) => chunks2(Chunk.__from_binding(chunk));
12385
12375
  }
12386
12376
  return chunks2;
12387
12377
  }
@@ -12439,9 +12429,9 @@ function toRawSplitChunksOptions(sc, compiler) {
12439
12429
  }
12440
12430
 
12441
12431
  // src/builtin-plugin/LightningCssMinimizerRspackPlugin.ts
12442
- var import_binding66 = require("@rspack/binding");
12432
+ var import_binding62 = require("@rspack/binding");
12443
12433
  var LightningCssMinimizerRspackPlugin = create2(
12444
- import_binding66.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
12434
+ import_binding62.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
12445
12435
  (options) => {
12446
12436
  var _a, _b, _c;
12447
12437
  const { include, exclude, draft, nonStandard, pseudoClasses, drafts } = (options == null ? void 0 : options.minimizerOptions) ?? {};
@@ -12469,16 +12459,16 @@ var LightningCssMinimizerRspackPlugin = create2(
12469
12459
  );
12470
12460
 
12471
12461
  // src/builtin-plugin/RemoveDuplicateModulesPlugin.ts
12472
- var import_binding67 = require("@rspack/binding");
12462
+ var import_binding63 = require("@rspack/binding");
12473
12463
  var RemoveDuplicateModulesPlugin = create2(
12474
- import_binding67.BuiltinPluginName.RemoveDuplicateModulesPlugin,
12464
+ import_binding63.BuiltinPluginName.RemoveDuplicateModulesPlugin,
12475
12465
  () => {
12476
12466
  return {};
12477
12467
  }
12478
12468
  );
12479
12469
 
12480
12470
  // src/builtin-plugin/SwcJsMinimizerPlugin.ts
12481
- var import_binding68 = require("@rspack/binding");
12471
+ var import_binding64 = require("@rspack/binding");
12482
12472
  function isObject2(value) {
12483
12473
  const type = typeof value;
12484
12474
  return value != null && (type === "object" || type === "function");
@@ -12521,7 +12511,7 @@ function getRawExtractCommentsOptions(extractComments) {
12521
12511
  return void 0;
12522
12512
  }
12523
12513
  var SwcJsMinimizerRspackPlugin = create2(
12524
- import_binding68.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
12514
+ import_binding64.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
12525
12515
  (options) => {
12526
12516
  var _a, _b, _c, _d, _e;
12527
12517
  let compress = ((_a = options == null ? void 0 : options.minimizerOptions) == null ? void 0 : _a.compress) ?? true;
@@ -12533,13 +12523,12 @@ var SwcJsMinimizerRspackPlugin = create2(
12533
12523
  };
12534
12524
  if (compress && typeof compress === "object") {
12535
12525
  compress = {
12536
- passes: 1,
12537
- // terser and swc use different default value: 0
12526
+ passes: 2,
12538
12527
  ...compress
12539
12528
  };
12540
12529
  } else if (compress) {
12541
12530
  compress = {
12542
- passes: 1
12531
+ passes: 2
12543
12532
  };
12544
12533
  }
12545
12534
  return {
@@ -12560,20 +12549,20 @@ var SwcJsMinimizerRspackPlugin = create2(
12560
12549
  );
12561
12550
 
12562
12551
  // src/builtin-plugin/WarnCaseSensitiveModulesPlugin.ts
12563
- var import_binding69 = require("@rspack/binding");
12552
+ var import_binding65 = require("@rspack/binding");
12564
12553
  var WarnCaseSensitiveModulesPlugin = create2(
12565
- import_binding69.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
12554
+ import_binding65.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
12566
12555
  () => {
12567
12556
  },
12568
12557
  "compilation"
12569
12558
  );
12570
12559
 
12571
12560
  // src/builtin-plugin/WebWorkerTemplatePlugin.ts
12572
- var import_binding70 = require("@rspack/binding");
12561
+ var import_binding66 = require("@rspack/binding");
12573
12562
  var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
12574
12563
  constructor() {
12575
12564
  super(...arguments);
12576
- this.name = import_binding70.BuiltinPluginName.WebWorkerTemplatePlugin;
12565
+ this.name = import_binding66.BuiltinPluginName.WebWorkerTemplatePlugin;
12577
12566
  }
12578
12567
  raw(compiler) {
12579
12568
  compiler.options.output.chunkLoading = "import-scripts";
@@ -12582,7 +12571,7 @@ var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
12582
12571
  };
12583
12572
 
12584
12573
  // src/builtin-plugin/WorkerPlugin.ts
12585
- var import_binding71 = require("@rspack/binding");
12574
+ var import_binding67 = require("@rspack/binding");
12586
12575
  var WorkerPlugin = class extends RspackBuiltinPlugin {
12587
12576
  constructor(chunkLoading2, wasmLoading2, module2, workerPublicPath2) {
12588
12577
  super();
@@ -12590,7 +12579,7 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
12590
12579
  this.wasmLoading = wasmLoading2;
12591
12580
  this.module = module2;
12592
12581
  this.workerPublicPath = workerPublicPath2;
12593
- this.name = import_binding71.BuiltinPluginName.WorkerPlugin;
12582
+ this.name = import_binding67.BuiltinPluginName.WorkerPlugin;
12594
12583
  }
12595
12584
  raw(compiler) {
12596
12585
  if (this.chunkLoading) {
@@ -12604,25 +12593,25 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
12604
12593
  };
12605
12594
 
12606
12595
  // src/builtin-plugin/FetchCompileAsyncWasmPlugin.ts
12607
- var import_binding72 = require("@rspack/binding");
12596
+ var import_binding68 = require("@rspack/binding");
12608
12597
  var FetchCompileAsyncWasmPlugin = create2(
12609
- import_binding72.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
12598
+ import_binding68.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
12610
12599
  () => {
12611
12600
  },
12612
12601
  "thisCompilation"
12613
12602
  );
12614
12603
 
12615
12604
  // src/builtin-plugin/NoEmitOnErrorsPlugin.ts
12616
- var import_binding73 = require("@rspack/binding");
12605
+ var import_binding69 = require("@rspack/binding");
12617
12606
  var NoEmitOnErrorsPlugin = create2(
12618
- import_binding73.BuiltinPluginName.NoEmitOnErrorsPlugin,
12607
+ import_binding69.BuiltinPluginName.NoEmitOnErrorsPlugin,
12619
12608
  () => void 0
12620
12609
  );
12621
12610
 
12622
12611
  // src/builtin-plugin/ContextReplacementPlugin.ts
12623
- var import_binding74 = require("@rspack/binding");
12612
+ var import_binding70 = require("@rspack/binding");
12624
12613
  var ContextReplacementPlugin = create2(
12625
- import_binding74.BuiltinPluginName.ContextReplacementPlugin,
12614
+ import_binding70.BuiltinPluginName.ContextReplacementPlugin,
12626
12615
  (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp) => {
12627
12616
  const rawOptions = {
12628
12617
  resourceRegExp
@@ -12652,26 +12641,26 @@ var ContextReplacementPlugin = create2(
12652
12641
  );
12653
12642
 
12654
12643
  // src/builtin-plugin/LibManifestPlugin.ts
12655
- var import_binding75 = require("@rspack/binding");
12644
+ var import_binding71 = require("@rspack/binding");
12656
12645
  var LibManifestPlugin = create2(
12657
- import_binding75.BuiltinPluginName.LibManifestPlugin,
12646
+ import_binding71.BuiltinPluginName.LibManifestPlugin,
12658
12647
  (options) => {
12659
- const { context: context2, entryOnly, format: format3, name: name2, path: path10, type } = options;
12648
+ const { context: context2, entryOnly, format: format3, name: name2, path: path11, type } = options;
12660
12649
  return {
12661
12650
  context: context2,
12662
12651
  entryOnly,
12663
12652
  format: format3,
12664
12653
  name: name2,
12665
- path: path10,
12654
+ path: path11,
12666
12655
  type
12667
12656
  };
12668
12657
  }
12669
12658
  );
12670
12659
 
12671
12660
  // src/builtin-plugin/DllEntryPlugin.ts
12672
- var import_binding76 = require("@rspack/binding");
12661
+ var import_binding72 = require("@rspack/binding");
12673
12662
  var DllEntryPlugin = create2(
12674
- import_binding76.BuiltinPluginName.DllEntryPlugin,
12663
+ import_binding72.BuiltinPluginName.DllEntryPlugin,
12675
12664
  (context2, entries, options) => {
12676
12665
  return {
12677
12666
  context: context2,
@@ -12682,9 +12671,9 @@ var DllEntryPlugin = create2(
12682
12671
  );
12683
12672
 
12684
12673
  // src/builtin-plugin/DllReferenceAgencyPlugin.ts
12685
- var import_binding77 = require("@rspack/binding");
12674
+ var import_binding73 = require("@rspack/binding");
12686
12675
  var DllReferenceAgencyPlugin = create2(
12687
- import_binding77.BuiltinPluginName.DllReferenceAgencyPlugin,
12676
+ import_binding73.BuiltinPluginName.DllReferenceAgencyPlugin,
12688
12677
  (options) => options
12689
12678
  );
12690
12679
 
@@ -12704,7 +12693,7 @@ var import_node_util5 = __toESM(require("util"));
12704
12693
 
12705
12694
  // src/util/fs.ts
12706
12695
  var import_node_assert6 = __toESM(require("assert"));
12707
- var import_node_path9 = __toESM(require("path"));
12696
+ var import_node_path10 = __toESM(require("path"));
12708
12697
  function rmrf(fs5, p, callback) {
12709
12698
  fs5.stat(p, (err, stats) => {
12710
12699
  if (err) {
@@ -12746,11 +12735,11 @@ var join2 = (fs5, rootPath, filename2) => {
12746
12735
  if (fs5 == null ? void 0 : fs5.join) {
12747
12736
  return fs5.join(rootPath, filename2);
12748
12737
  }
12749
- if (import_node_path9.default.posix.isAbsolute(rootPath)) {
12750
- return import_node_path9.default.posix.join(rootPath, filename2);
12738
+ if (import_node_path10.default.posix.isAbsolute(rootPath)) {
12739
+ return import_node_path10.default.posix.join(rootPath, filename2);
12751
12740
  }
12752
- if (import_node_path9.default.win32.isAbsolute(rootPath)) {
12753
- return import_node_path9.default.win32.join(rootPath, filename2);
12741
+ if (import_node_path10.default.win32.isAbsolute(rootPath)) {
12742
+ return import_node_path10.default.win32.join(rootPath, filename2);
12754
12743
  }
12755
12744
  throw new Error(
12756
12745
  `${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system`
@@ -12760,11 +12749,11 @@ var dirname2 = (fs5, absPath) => {
12760
12749
  if (fs5 == null ? void 0 : fs5.dirname) {
12761
12750
  return fs5.dirname(absPath);
12762
12751
  }
12763
- if (import_node_path9.default.posix.isAbsolute(absPath)) {
12764
- return import_node_path9.default.posix.dirname(absPath);
12752
+ if (import_node_path10.default.posix.isAbsolute(absPath)) {
12753
+ return import_node_path10.default.posix.dirname(absPath);
12765
12754
  }
12766
- if (import_node_path9.default.win32.isAbsolute(absPath)) {
12767
- return import_node_path9.default.win32.dirname(absPath);
12755
+ if (import_node_path10.default.win32.isAbsolute(absPath)) {
12756
+ return import_node_path10.default.win32.dirname(absPath);
12768
12757
  }
12769
12758
  throw new Error(
12770
12759
  `${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`
@@ -12811,41 +12800,26 @@ var mkdirp = (fs5, p, callback) => {
12811
12800
 
12812
12801
  // src/FileSystem.ts
12813
12802
  var BUFFER_SIZE = 1e3;
12803
+ var ASYNC_NOOP = async () => {
12804
+ };
12814
12805
  var NOOP_FILESYSTEM = {
12815
- writeFile() {
12816
- },
12817
- removeFile() {
12818
- },
12819
- mkdir() {
12820
- },
12821
- mkdirp() {
12822
- },
12823
- removeDirAll() {
12824
- },
12825
- readDir: () => {
12826
- },
12827
- readFile: () => {
12828
- },
12829
- stat: () => {
12830
- },
12831
- lstat: () => {
12832
- },
12833
- open: () => {
12834
- },
12835
- rename: () => {
12836
- },
12837
- close: () => {
12838
- },
12839
- write: () => {
12840
- },
12841
- writeAll: () => {
12842
- },
12843
- read: () => {
12844
- },
12845
- readUntil: () => {
12846
- },
12847
- readToEnd: () => {
12848
- }
12806
+ writeFile: ASYNC_NOOP,
12807
+ removeFile: ASYNC_NOOP,
12808
+ mkdir: ASYNC_NOOP,
12809
+ mkdirp: ASYNC_NOOP,
12810
+ removeDirAll: ASYNC_NOOP,
12811
+ readDir: ASYNC_NOOP,
12812
+ readFile: ASYNC_NOOP,
12813
+ stat: ASYNC_NOOP,
12814
+ lstat: ASYNC_NOOP,
12815
+ open: ASYNC_NOOP,
12816
+ rename: ASYNC_NOOP,
12817
+ close: ASYNC_NOOP,
12818
+ write: ASYNC_NOOP,
12819
+ writeAll: ASYNC_NOOP,
12820
+ read: ASYNC_NOOP,
12821
+ readUntil: ASYNC_NOOP,
12822
+ readToEnd: ASYNC_NOOP
12849
12823
  };
12850
12824
  var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
12851
12825
  constructor(fs5) {
@@ -12870,15 +12844,7 @@ var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
12870
12844
  const statFn = import_node_util5.default.promisify(fs5.stat.bind(fs5));
12871
12845
  return async (filePath) => {
12872
12846
  const res = await statFn(filePath);
12873
- return res && {
12874
- isFile: res.isFile(),
12875
- isDirectory: res.isDirectory(),
12876
- atimeMs: res.atimeMs,
12877
- mtimeMs: res.atimeMs,
12878
- ctimeMs: res.atimeMs,
12879
- birthtimeMs: res.birthtimeMs,
12880
- size: res.size
12881
- };
12847
+ return res && _ThreadsafeOutputNodeFS.__to_binding_stat(res);
12882
12848
  };
12883
12849
  });
12884
12850
  this.lstat = memoizeFn(() => {
@@ -12896,6 +12862,7 @@ var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
12896
12862
  return {
12897
12863
  isFile: stat.isFile(),
12898
12864
  isDirectory: stat.isDirectory(),
12865
+ isSymlink: stat.isSymbolicLink(),
12899
12866
  atimeMs: stat.atimeMs,
12900
12867
  mtimeMs: stat.atimeMs,
12901
12868
  ctimeMs: stat.atimeMs,
@@ -13067,6 +13034,9 @@ var Watching = class {
13067
13034
  if (typeof this.watchOptions.aggregateTimeout !== "number") {
13068
13035
  this.watchOptions.aggregateTimeout = 5;
13069
13036
  }
13037
+ if (this.watchOptions.ignored === void 0) {
13038
+ this.watchOptions.ignored = /[\\/](?:\.git|node_modules)[\\/]/;
13039
+ }
13070
13040
  process.nextTick(() => {
13071
13041
  if (this.#initial) this.#invalidate();
13072
13042
  });
@@ -13208,18 +13178,38 @@ var Watching = class {
13208
13178
  this.invalid = false;
13209
13179
  this.#invalidReported = false;
13210
13180
  this.compiler.hooks.watchRun.callAsync(this.compiler, (err) => {
13211
- if (err) return this._done(err, null);
13181
+ if (err) return this._done(err);
13212
13182
  const canRebuild = !this.#initial && ((modifiedFiles == null ? void 0 : modifiedFiles.size) || (deleteFiles == null ? void 0 : deleteFiles.size));
13213
- const onCompile = (err2) => {
13214
- if (err2) return this._done(err2, null);
13183
+ const onCompiled = (err2, _compilation) => {
13184
+ if (err2) return this._done(err2);
13185
+ const compilation = _compilation;
13186
+ const needAdditionalPass = compilation.hooks.needAdditionalPass.call();
13187
+ if (needAdditionalPass) {
13188
+ compilation.needAdditionalPass = true;
13189
+ compilation.startTime = this.startTime;
13190
+ compilation.endTime = Date.now();
13191
+ const stats = new Stats(compilation);
13192
+ this.compiler.hooks.done.callAsync(stats, (err3) => {
13193
+ if (err3) return this._done(err3, compilation);
13194
+ this.compiler.hooks.additionalPass.callAsync((err4) => {
13195
+ if (err4) return this._done(err4, compilation);
13196
+ this.compiler.compile(onCompiled);
13197
+ });
13198
+ });
13199
+ return;
13200
+ }
13215
13201
  this._done(null, this.compiler._lastCompilation);
13216
13202
  };
13217
- this.compiler.compile(onCompile);
13203
+ this.compiler.compile(onCompiled);
13218
13204
  if (!canRebuild) {
13219
13205
  this.#initial = false;
13220
13206
  }
13221
13207
  });
13222
13208
  }
13209
+ /**
13210
+ * The reason why this is _done instead of #done, is that in Webpack,
13211
+ * it will rewrite this function to another function
13212
+ */
13223
13213
  _done(error, compilation) {
13224
13214
  this.running = false;
13225
13215
  let stats = void 0;
@@ -13288,7 +13278,7 @@ var Watching = class {
13288
13278
 
13289
13279
  // src/util/bindingVersionCheck.ts
13290
13280
  var import_node_fs3 = require("fs");
13291
- var import_node_path10 = __toESM(require("path"));
13281
+ var import_node_path11 = __toESM(require("path"));
13292
13282
  var NodePlatformArchToAbi = {
13293
13283
  android: {
13294
13284
  arm64: "",
@@ -13360,7 +13350,7 @@ var checkVersion = () => {
13360
13350
  }
13361
13351
  let ADDON_VERSION;
13362
13352
  try {
13363
- const BINDING_PKG_DIR = import_node_path10.default.dirname(
13353
+ const BINDING_PKG_DIR = import_node_path11.default.dirname(
13364
13354
  require.resolve("@rspack/binding/package.json")
13365
13355
  );
13366
13356
  const isLocal = (0, import_node_fs3.readdirSync)(BINDING_PKG_DIR).some(
@@ -13386,7 +13376,8 @@ var checkVersion = () => {
13386
13376
  );
13387
13377
  if (!isMatch) {
13388
13378
  return result = new Error(
13389
- `Unmatched version @rspack/core@${CORE_VERSION}, @rspack/binding@${BINDING_VERSION}, @rspack/binding-${platformArchAbi}@${ADDON_VERSION}`
13379
+ `Unmatched version @rspack/core@${CORE_VERSION}, @rspack/binding@${BINDING_VERSION}, @rspack/binding-${platformArchAbi}@${ADDON_VERSION}.
13380
+ Rspack requires these versions to be the same or you may have installed the wrong version. Otherwise, Rspack may not work properly.`
13390
13381
  );
13391
13382
  }
13392
13383
  return result = null;
@@ -13450,7 +13441,8 @@ var Compiler = class _Compiler {
13450
13441
  beforeCompile: new liteTapable7.AsyncSeriesHook(["params"]),
13451
13442
  afterCompile: new liteTapable7.AsyncSeriesHook(["compilation"]),
13452
13443
  finishMake: new liteTapable7.AsyncSeriesHook(["compilation"]),
13453
- entryOption: new liteTapable7.SyncBailHook(["context", "entry"])
13444
+ entryOption: new liteTapable7.SyncBailHook(["context", "entry"]),
13445
+ additionalPass: new liteTapable7.AsyncSeriesHook([])
13454
13446
  };
13455
13447
  this.webpack = rspack;
13456
13448
  this.rspack = rspack;
@@ -13471,14 +13463,6 @@ var Compiler = class _Compiler {
13471
13463
  this.watchMode = false;
13472
13464
  new JsLoaderRspackPlugin(this).apply(this);
13473
13465
  new ExecuteModulePlugin().apply(this);
13474
- this.hooks.shutdown.tap("rspack:cleanup", () => {
13475
- if (!this.running) {
13476
- process.nextTick(() => {
13477
- this.#instance = void 0;
13478
- this.#compilation && (this.#compilation.__internal__shutdown = true);
13479
- });
13480
- }
13481
- });
13482
13466
  }
13483
13467
  get recordsInputPath() {
13484
13468
  return unsupported("Compiler.recordsInputPath");
@@ -13626,20 +13610,51 @@ var Compiler = class _Compiler {
13626
13610
  }
13627
13611
  const startTime = Date.now();
13628
13612
  this.running = true;
13629
- const doRun = () => {
13630
- const finalCallback = (err, stats) => {
13631
- this.idle = true;
13632
- this.cache.beginIdle();
13633
- this.idle = true;
13634
- this.running = false;
13635
- if (err) {
13636
- this.hooks.failed.call(err);
13637
- }
13638
- if (callback) {
13639
- callback(err, stats);
13613
+ const finalCallback = (err, stats) => {
13614
+ this.idle = true;
13615
+ this.cache.beginIdle();
13616
+ this.idle = true;
13617
+ this.running = false;
13618
+ if (err) {
13619
+ this.hooks.failed.call(err);
13620
+ }
13621
+ if (callback) {
13622
+ callback(err, stats);
13623
+ }
13624
+ this.hooks.afterDone.call(stats);
13625
+ };
13626
+ const onCompiled = (err, _compilation) => {
13627
+ if (err) {
13628
+ return finalCallback(err);
13629
+ }
13630
+ const compilation = _compilation;
13631
+ if (compilation.hooks.needAdditionalPass.call()) {
13632
+ compilation.needAdditionalPass = true;
13633
+ compilation.startTime = startTime;
13634
+ compilation.endTime = Date.now();
13635
+ const stats2 = new Stats(compilation);
13636
+ this.hooks.done.callAsync(stats2, (err2) => {
13637
+ if (err2) {
13638
+ return finalCallback(err2);
13639
+ }
13640
+ this.hooks.additionalPass.callAsync((err3) => {
13641
+ if (err3) return finalCallback(err3);
13642
+ this.compile(onCompiled);
13643
+ });
13644
+ });
13645
+ return;
13646
+ }
13647
+ compilation.startTime = startTime;
13648
+ compilation.endTime = Date.now();
13649
+ const stats = new Stats(compilation);
13650
+ this.hooks.done.callAsync(stats, (err2) => {
13651
+ if (err2) {
13652
+ return finalCallback(err2);
13640
13653
  }
13641
- this.hooks.afterDone.call(stats);
13642
- };
13654
+ return finalCallback(null, stats);
13655
+ });
13656
+ };
13657
+ const run = () => {
13643
13658
  this.hooks.beforeRun.callAsync(this, (err) => {
13644
13659
  if (err) {
13645
13660
  return finalCallback(err);
@@ -13648,20 +13663,7 @@ var Compiler = class _Compiler {
13648
13663
  if (err2) {
13649
13664
  return finalCallback(err2);
13650
13665
  }
13651
- this.compile((err3) => {
13652
- if (err3) {
13653
- return finalCallback(err3);
13654
- }
13655
- this.#compilation.startTime = startTime;
13656
- this.#compilation.endTime = Date.now();
13657
- const stats = new Stats(this.#compilation);
13658
- this.hooks.done.callAsync(stats, (err4) => {
13659
- if (err4) {
13660
- return finalCallback(err4);
13661
- }
13662
- return finalCallback(null, stats);
13663
- });
13664
- });
13666
+ this.compile(onCompiled);
13665
13667
  });
13666
13668
  });
13667
13669
  };
@@ -13669,10 +13671,10 @@ var Compiler = class _Compiler {
13669
13671
  this.cache.endIdle((err) => {
13670
13672
  if (err) return callback(err);
13671
13673
  this.idle = false;
13672
- doRun();
13674
+ run();
13673
13675
  });
13674
13676
  } else {
13675
- doRun();
13677
+ run();
13676
13678
  }
13677
13679
  }
13678
13680
  runAsChild(callback) {
@@ -14037,10 +14039,7 @@ var Compiler = class _Compiler {
14037
14039
  runtimeRequirements
14038
14040
  }) {
14039
14041
  const set = __from_binding_runtime_globals(runtimeRequirements);
14040
- queried.call(
14041
- Chunk.__from_binding(chunk, that.deref().#compilation),
14042
- set
14043
- );
14042
+ queried.call(Chunk.__from_binding(chunk), set);
14044
14043
  return {
14045
14044
  runtimeRequirements: __to_binding_runtime_globals(set)
14046
14045
  };
@@ -14054,14 +14053,11 @@ var Compiler = class _Compiler {
14054
14053
  },
14055
14054
  function(queried) {
14056
14055
  return function({
14057
- chunk: rawChunk,
14056
+ chunk: chunkBinding,
14058
14057
  runtimeRequirements
14059
14058
  }) {
14060
14059
  const set = __from_binding_runtime_globals(runtimeRequirements);
14061
- const chunk = Chunk.__from_binding(
14062
- rawChunk,
14063
- that.deref().#compilation
14064
- );
14060
+ const chunk = Chunk.__from_binding(chunkBinding);
14065
14061
  for (const r of set) {
14066
14062
  queried.for(r).call(chunk, set);
14067
14063
  }
@@ -14080,10 +14076,7 @@ var Compiler = class _Compiler {
14080
14076
  return function({ module: module2, chunk }) {
14081
14077
  var _a, _b;
14082
14078
  const originSource = (_a = module2.source) == null ? void 0 : _a.source;
14083
- queried.call(
14084
- module2,
14085
- Chunk.__from_binding(chunk, that.deref().#compilation)
14086
- );
14079
+ queried.call(module2, Chunk.__from_binding(chunk));
14087
14080
  const newSource = (_b = module2.source) == null ? void 0 : _b.source;
14088
14081
  if (newSource && newSource !== originSource) {
14089
14082
  return module2;
@@ -14099,9 +14092,7 @@ var Compiler = class _Compiler {
14099
14092
  },
14100
14093
  function(queried) {
14101
14094
  return function(m) {
14102
- return queried.call(
14103
- Module.__from_binding(m, that.deref().#compilation)
14104
- );
14095
+ return queried.call(Module.__from_binding(m));
14105
14096
  };
14106
14097
  }
14107
14098
  ),
@@ -14112,9 +14103,7 @@ var Compiler = class _Compiler {
14112
14103
  },
14113
14104
  function(queried) {
14114
14105
  return function(m) {
14115
- return queried.call(
14116
- Module.__from_binding(m, that.deref().#compilation)
14117
- );
14106
+ return queried.call(Module.__from_binding(m));
14118
14107
  };
14119
14108
  }
14120
14109
  ),
@@ -14125,9 +14114,7 @@ var Compiler = class _Compiler {
14125
14114
  },
14126
14115
  function(queried) {
14127
14116
  return function(m) {
14128
- return queried.call(
14129
- Module.__from_binding(m, that.deref().#compilation)
14130
- );
14117
+ return queried.call(Module.__from_binding(m));
14131
14118
  };
14132
14119
  }
14133
14120
  ),
@@ -14143,54 +14130,59 @@ var Compiler = class _Compiler {
14143
14130
  codegenResults,
14144
14131
  runtimeModules
14145
14132
  }) {
14146
- const __webpack_require__ = (id2) => {
14147
- const cached = moduleCache[id2];
14148
- if (cached !== void 0) {
14149
- if (cached.error) throw cached.error;
14150
- return cached.exports;
14151
- }
14152
- const execOptions = {
14153
- id: id2,
14154
- module: {
14133
+ try {
14134
+ const __webpack_require__ = (id2) => {
14135
+ const cached = moduleCache[id2];
14136
+ if (cached !== void 0) {
14137
+ if (cached.error) throw cached.error;
14138
+ return cached.exports;
14139
+ }
14140
+ const execOptions = {
14155
14141
  id: id2,
14156
- exports: {},
14157
- loaded: false,
14158
- error: void 0
14159
- },
14160
- require: __webpack_require__
14142
+ module: {
14143
+ id: id2,
14144
+ exports: {},
14145
+ loaded: false,
14146
+ error: void 0
14147
+ },
14148
+ require: __webpack_require__
14149
+ };
14150
+ for (const handler of interceptModuleExecution) {
14151
+ handler(execOptions);
14152
+ }
14153
+ const result2 = codegenResults.map[id2]["build time"];
14154
+ const moduleObject = execOptions.module;
14155
+ if (id2) moduleCache[id2] = moduleObject;
14156
+ tryRunOrWebpackError(
14157
+ () => queried.call(
14158
+ {
14159
+ codeGenerationResult: new CodeGenerationResult(result2),
14160
+ moduleObject
14161
+ },
14162
+ { __webpack_require__ }
14163
+ ),
14164
+ "Compilation.hooks.executeModule"
14165
+ );
14166
+ moduleObject.loaded = true;
14167
+ return moduleObject.exports;
14161
14168
  };
14162
- for (const handler of interceptModuleExecution) {
14163
- handler(execOptions);
14169
+ const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
14170
+ `${RuntimeGlobals.require}.`,
14171
+ ""
14172
+ )] = {};
14173
+ const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
14174
+ `${RuntimeGlobals.require}.`,
14175
+ ""
14176
+ )] = [];
14177
+ for (const runtimeModule of runtimeModules) {
14178
+ __webpack_require__(runtimeModule);
14164
14179
  }
14165
- const result2 = codegenResults.map[id2]["build time"];
14166
- const moduleObject = execOptions.module;
14167
- if (id2) moduleCache[id2] = moduleObject;
14168
- tryRunOrWebpackError(
14169
- () => queried.call(
14170
- {
14171
- codeGenerationResult: new CodeGenerationResult(result2),
14172
- moduleObject
14173
- },
14174
- { __webpack_require__ }
14175
- ),
14176
- "Compilation.hooks.executeModule"
14177
- );
14178
- moduleObject.loaded = true;
14179
- return moduleObject.exports;
14180
- };
14181
- const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
14182
- `${RuntimeGlobals.require}.`,
14183
- ""
14184
- )] = {};
14185
- const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
14186
- `${RuntimeGlobals.require}.`,
14187
- ""
14188
- )] = [];
14189
- for (const runtimeModule of runtimeModules) {
14190
- __webpack_require__(runtimeModule);
14180
+ const executeResult = __webpack_require__(entry2);
14181
+ that.deref().#moduleExecutionResultsMap.set(id, executeResult);
14182
+ } catch (e) {
14183
+ that.deref().#moduleExecutionResultsMap.set(id, e);
14184
+ throw e;
14191
14185
  }
14192
- const executeResult = __webpack_require__(entry2);
14193
- that.deref().#moduleExecutionResultsMap.set(id, executeResult);
14194
14186
  };
14195
14187
  }
14196
14188
  ),
@@ -14266,10 +14258,7 @@ var Compiler = class _Compiler {
14266
14258
  throw new Error("'output.hashFunction' cannot be undefined");
14267
14259
  }
14268
14260
  const hash = createHash(that.deref().options.output.hashFunction);
14269
- queried.call(
14270
- Chunk.__from_binding(chunk, that.deref().#compilation),
14271
- hash
14272
- );
14261
+ queried.call(Chunk.__from_binding(chunk), hash);
14273
14262
  const digestResult = hash.digest(
14274
14263
  that.deref().options.output.hashDigest
14275
14264
  );
@@ -14284,10 +14273,7 @@ var Compiler = class _Compiler {
14284
14273
  },
14285
14274
  function(queried) {
14286
14275
  return function({ chunk, filename: filename2 }) {
14287
- return queried.call(
14288
- Chunk.__from_binding(chunk, that.deref().#compilation),
14289
- filename2
14290
- );
14276
+ return queried.call(Chunk.__from_binding(chunk), filename2);
14291
14277
  };
14292
14278
  }
14293
14279
  ),
@@ -14500,10 +14486,7 @@ var Compiler = class _Compiler {
14500
14486
  throw new Error("'output.hashFunction' cannot be undefined");
14501
14487
  }
14502
14488
  const hash = createHash(that.deref().options.output.hashFunction);
14503
- queried.call(
14504
- Chunk.__from_binding(chunk, that.deref().#compilation),
14505
- hash
14506
- );
14489
+ queried.call(Chunk.__from_binding(chunk), hash);
14507
14490
  const digestResult = hash.digest(
14508
14491
  that.deref().options.output.hashDigest
14509
14492
  );
@@ -14626,11 +14609,12 @@ var Compiler = class _Compiler {
14626
14609
  )
14627
14610
  };
14628
14611
  this.#instance = new instanceBinding.Rspack(
14612
+ this.compilerPath,
14629
14613
  rawOptions,
14630
14614
  this.#builtinPlugins,
14631
14615
  this.#registers,
14632
14616
  ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem),
14633
- ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem),
14617
+ this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0,
14634
14618
  ResolverFactory.__to_binding(this.resolverFactory)
14635
14619
  );
14636
14620
  callback(null, this.#instance);
@@ -15791,17 +15775,17 @@ var ASSETS_GROUPERS = {
15791
15775
  const extensionMatch = groupAssetsByExtension && GROUP_EXTENSION_REGEXP.exec(asset.name);
15792
15776
  const extension = extensionMatch ? extensionMatch[1] : "";
15793
15777
  const pathMatch = groupAssetsByPath && GROUP_PATH_REGEXP.exec(asset.name);
15794
- const path10 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
15778
+ const path11 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
15795
15779
  const keys = [];
15796
15780
  if (groupAssetsByPath) {
15797
15781
  keys.push(".");
15798
15782
  if (extension)
15799
15783
  keys.push(
15800
- path10.length ? `${path10.join("/")}/*${extension}` : `*${extension}`
15784
+ path11.length ? `${path11.join("/")}/*${extension}` : `*${extension}`
15801
15785
  );
15802
- while (path10.length > 0) {
15803
- keys.push(`${path10.join("/")}/`);
15804
- path10.pop();
15786
+ while (path11.length > 0) {
15787
+ keys.push(`${path11.join("/")}/`);
15788
+ path11.pop();
15805
15789
  }
15806
15790
  } else {
15807
15791
  if (extension) keys.push(`*${extension}`);
@@ -15987,16 +15971,16 @@ var MODULES_GROUPERS = (type) => ({
15987
15971
  const extensionMatch = groupModulesByExtension && GROUP_EXTENSION_REGEXP.exec(resource);
15988
15972
  const extension = extensionMatch ? extensionMatch[1] : "";
15989
15973
  const pathMatch = groupModulesByPath && GROUP_PATH_REGEXP.exec(resource);
15990
- const path10 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
15974
+ const path11 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
15991
15975
  const keys = [];
15992
15976
  if (groupModulesByPath) {
15993
15977
  if (extension)
15994
15978
  keys.push(
15995
- path10.length ? `${path10.join("/")}/*${extension}` : `*${extension}`
15979
+ path11.length ? `${path11.join("/")}/*${extension}` : `*${extension}`
15996
15980
  );
15997
- while (path10.length > 0) {
15998
- keys.push(`${path10.join("/")}/`);
15999
- path10.pop();
15981
+ while (path11.length > 0) {
15982
+ keys.push(`${path11.join("/")}/`);
15983
+ path11.pop();
16000
15984
  }
16001
15985
  } else {
16002
15986
  if (extension) keys.push(`*${extension}`);
@@ -18497,6 +18481,7 @@ var RspackOptionsApply = class {
18497
18481
  switch (chunkIds) {
18498
18482
  case "natural": {
18499
18483
  new NaturalChunkIdsPlugin().apply(compiler);
18484
+ break;
18500
18485
  }
18501
18486
  case "named": {
18502
18487
  new NamedChunkIdsPlugin().apply(compiler);
@@ -18506,6 +18491,18 @@ var RspackOptionsApply = class {
18506
18491
  new DeterministicChunkIdsPlugin().apply(compiler);
18507
18492
  break;
18508
18493
  }
18494
+ case "size": {
18495
+ new OccurrenceChunkIdsPlugin({
18496
+ prioritiseInitial: true
18497
+ }).apply(compiler);
18498
+ break;
18499
+ }
18500
+ case "total-size": {
18501
+ new OccurrenceChunkIdsPlugin({
18502
+ prioritiseInitial: false
18503
+ }).apply(compiler);
18504
+ break;
18505
+ }
18509
18506
  default:
18510
18507
  throw new Error(`chunkIds: ${chunkIds} is not implemented`);
18511
18508
  }
@@ -18528,7 +18525,6 @@ var RspackOptionsApply = class {
18528
18525
  if (options.performance) {
18529
18526
  new SizeLimitsPlugin(options.performance).apply(compiler);
18530
18527
  }
18531
- new WarnCaseSensitiveModulesPlugin().apply(compiler);
18532
18528
  if (options.cache) {
18533
18529
  new MemoryCachePlugin().apply(compiler);
18534
18530
  }
@@ -18595,9 +18591,9 @@ var matchObject = (obj, str) => {
18595
18591
  var import_zod5 = __toESM(require("../compiled/zod/index.js"));
18596
18592
 
18597
18593
  // src/builtin-plugin/FlagAllModulesAsUsedPlugin.ts
18598
- var import_binding78 = require("@rspack/binding");
18594
+ var import_binding74 = require("@rspack/binding");
18599
18595
  var FlagAllModulesAsUsedPlugin = create2(
18600
- import_binding78.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
18596
+ import_binding74.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
18601
18597
  (explanation) => {
18602
18598
  return {
18603
18599
  explanation
@@ -19460,7 +19456,7 @@ var NodeEnvironmentPlugin = class {
19460
19456
  );
19461
19457
  compiler.inputFileSystem = inputFileSystem;
19462
19458
  compiler.outputFileSystem = import_graceful_fs2.default;
19463
- compiler.intermediateFileSystem = import_graceful_fs2.default;
19459
+ compiler.intermediateFileSystem = null;
19464
19460
  compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem);
19465
19461
  compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler2) => {
19466
19462
  var _a;
@@ -19486,9 +19482,9 @@ var NodeTemplatePlugin = class {
19486
19482
  };
19487
19483
 
19488
19484
  // src/container/ModuleFederationRuntimePlugin.ts
19489
- var import_binding79 = require("@rspack/binding");
19485
+ var import_binding75 = require("@rspack/binding");
19490
19486
  var ModuleFederationRuntimePlugin = create2(
19491
- import_binding79.BuiltinPluginName.ModuleFederationRuntimePlugin,
19487
+ import_binding75.BuiltinPluginName.ModuleFederationRuntimePlugin,
19492
19488
  () => {
19493
19489
  }
19494
19490
  );
@@ -19684,10 +19680,10 @@ function getDefaultEntryRuntime(paths, options, compiler) {
19684
19680
  }
19685
19681
 
19686
19682
  // src/sharing/ConsumeSharedPlugin.ts
19687
- var import_binding81 = require("@rspack/binding");
19683
+ var import_binding77 = require("@rspack/binding");
19688
19684
 
19689
19685
  // src/sharing/ShareRuntimePlugin.ts
19690
- var import_binding80 = require("@rspack/binding");
19686
+ var import_binding76 = require("@rspack/binding");
19691
19687
  var compilerSet = /* @__PURE__ */ new WeakSet();
19692
19688
  function isSingleton(compiler) {
19693
19689
  return compilerSet.has(compiler);
@@ -19699,7 +19695,7 @@ var ShareRuntimePlugin = class extends RspackBuiltinPlugin {
19699
19695
  constructor(enhanced = false) {
19700
19696
  super();
19701
19697
  this.enhanced = enhanced;
19702
- this.name = import_binding80.BuiltinPluginName.ShareRuntimePlugin;
19698
+ this.name = import_binding76.BuiltinPluginName.ShareRuntimePlugin;
19703
19699
  }
19704
19700
  raw(compiler) {
19705
19701
  if (isSingleton(compiler)) return;
@@ -19718,7 +19714,7 @@ function isRequiredVersion(str) {
19718
19714
  var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
19719
19715
  constructor(options) {
19720
19716
  super();
19721
- this.name = import_binding81.BuiltinPluginName.ConsumeSharedPlugin;
19717
+ this.name = import_binding77.BuiltinPluginName.ConsumeSharedPlugin;
19722
19718
  this._options = {
19723
19719
  consumes: parseOptions(
19724
19720
  options.consumes,
@@ -19781,11 +19777,11 @@ var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
19781
19777
  };
19782
19778
 
19783
19779
  // src/sharing/ProvideSharedPlugin.ts
19784
- var import_binding82 = require("@rspack/binding");
19780
+ var import_binding78 = require("@rspack/binding");
19785
19781
  var ProvideSharedPlugin = class extends RspackBuiltinPlugin {
19786
19782
  constructor(options) {
19787
19783
  super();
19788
- this.name = import_binding82.BuiltinPluginName.ProvideSharedPlugin;
19784
+ this.name = import_binding78.BuiltinPluginName.ProvideSharedPlugin;
19789
19785
  this._provides = parseOptions(
19790
19786
  options.provides,
19791
19787
  (item) => {
@@ -19890,11 +19886,11 @@ var SharePlugin = class {
19890
19886
  };
19891
19887
 
19892
19888
  // src/container/ContainerPlugin.ts
19893
- var import_binding83 = require("@rspack/binding");
19889
+ var import_binding79 = require("@rspack/binding");
19894
19890
  var ContainerPlugin = class extends RspackBuiltinPlugin {
19895
19891
  constructor(options) {
19896
19892
  super();
19897
- this.name = import_binding83.BuiltinPluginName.ContainerPlugin;
19893
+ this.name = import_binding79.BuiltinPluginName.ContainerPlugin;
19898
19894
  this._options = {
19899
19895
  name: options.name,
19900
19896
  shareScope: options.shareScope || "default",
@@ -19927,7 +19923,7 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
19927
19923
  const rawOptions = {
19928
19924
  name: name2,
19929
19925
  shareScope,
19930
- library: getRawLibrary(library3),
19926
+ library: library3,
19931
19927
  runtime,
19932
19928
  filename: filename2,
19933
19929
  exposes: exposes.map(([key, r]) => ({ key, ...r })),
@@ -19938,11 +19934,11 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
19938
19934
  };
19939
19935
 
19940
19936
  // src/container/ContainerReferencePlugin.ts
19941
- var import_binding84 = require("@rspack/binding");
19937
+ var import_binding80 = require("@rspack/binding");
19942
19938
  var ContainerReferencePlugin = class extends RspackBuiltinPlugin {
19943
19939
  constructor(options) {
19944
19940
  super();
19945
- this.name = import_binding84.BuiltinPluginName.ContainerReferencePlugin;
19941
+ this.name = import_binding80.BuiltinPluginName.ContainerReferencePlugin;
19946
19942
  this._options = {
19947
19943
  remoteType: options.remoteType,
19948
19944
  remotes: parseOptions(
@@ -20027,7 +20023,7 @@ var ModuleFederationPluginV1 = class {
20027
20023
  };
20028
20024
 
20029
20025
  // src/exports.ts
20030
- var import_binding85 = require("@rspack/binding");
20026
+ var import_binding81 = require("@rspack/binding");
20031
20027
  var rspackVersion = import_package.version;
20032
20028
  var version = import_package.webpackVersion;
20033
20029
  var WebpackError2 = Error;
@@ -20073,8 +20069,8 @@ var sharing = {
20073
20069
  };
20074
20070
  var experiments2 = {
20075
20071
  globalTrace: {
20076
- register: import_binding85.registerGlobalTrace,
20077
- cleanup: import_binding85.cleanupGlobalTrace
20072
+ register: import_binding81.registerGlobalTrace,
20073
+ cleanup: import_binding81.cleanupGlobalTrace
20078
20074
  },
20079
20075
  RemoveDuplicateModulesPlugin
20080
20076
  };
@@ -20226,6 +20222,7 @@ module.exports = rspack;
20226
20222
  SwcJsMinimizerRspackPlugin,
20227
20223
  Template,
20228
20224
  ValidationError,
20225
+ WarnCaseSensitiveModulesPlugin,
20229
20226
  WebpackError,
20230
20227
  WebpackOptionsApply,
20231
20228
  config,