@rspack/core 1.3.12 → 1.3.14

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 (156) hide show
  1. package/README.md +2 -2
  2. package/compiled/browserslist-load-config/index.d.ts +10 -0
  3. package/compiled/browserslist-load-config/index.js +266 -0
  4. package/compiled/browserslist-load-config/license +21 -0
  5. package/compiled/browserslist-load-config/package.json +1 -0
  6. package/compiled/watchpack/index.js +18 -14
  7. package/compiled/watchpack/package.json +1 -1
  8. package/compiled/zod/dist/types/v3/types.d.ts +2 -2
  9. package/compiled/zod/dist/types/v4/classic/coerce.d.ts +5 -5
  10. package/compiled/zod/dist/types/v4/classic/external.d.ts +6 -1
  11. package/compiled/zod/dist/types/v4/classic/schemas.d.ts +95 -133
  12. package/compiled/zod/dist/types/v4/core/api.d.ts +2 -2
  13. package/compiled/zod/dist/types/v4/core/core.d.ts +11 -7
  14. package/compiled/zod/dist/types/v4/core/errors.d.ts +0 -1
  15. package/compiled/zod/dist/types/v4/core/function.d.ts +16 -11
  16. package/compiled/zod/dist/types/v4/core/regexes.d.ts +1 -1
  17. package/compiled/zod/dist/types/v4/core/registries.d.ts +6 -1
  18. package/compiled/zod/dist/types/v4/core/schemas.d.ts +145 -117
  19. package/compiled/zod/dist/types/v4/core/util.d.ts +5 -9
  20. package/compiled/zod/dist/types/v4/locales/ar.d.ts +0 -3
  21. package/compiled/zod/dist/types/v4/locales/az.d.ts +0 -3
  22. package/compiled/zod/dist/types/v4/locales/be.d.ts +0 -3
  23. package/compiled/zod/dist/types/v4/locales/ca.d.ts +0 -3
  24. package/compiled/zod/dist/types/v4/locales/cs.d.ts +0 -3
  25. package/compiled/zod/dist/types/v4/locales/de.d.ts +0 -3
  26. package/compiled/zod/dist/types/v4/locales/en.d.ts +0 -2
  27. package/compiled/zod/dist/types/v4/locales/es.d.ts +0 -3
  28. package/compiled/zod/dist/types/v4/locales/fa.d.ts +0 -3
  29. package/compiled/zod/dist/types/v4/locales/fi.d.ts +0 -3
  30. package/compiled/zod/dist/types/v4/locales/{frCA.d.ts → fr-CA.d.ts} +0 -3
  31. package/compiled/zod/dist/types/v4/locales/fr.d.ts +0 -3
  32. package/compiled/zod/dist/types/v4/locales/he.d.ts +0 -3
  33. package/compiled/zod/dist/types/v4/locales/hu.d.ts +0 -3
  34. package/compiled/zod/dist/types/v4/locales/id.d.ts +0 -3
  35. package/compiled/zod/dist/types/v4/locales/index.d.ts +5 -2
  36. package/compiled/zod/dist/types/v4/locales/it.d.ts +0 -3
  37. package/compiled/zod/dist/types/v4/locales/ja.d.ts +0 -3
  38. package/compiled/zod/dist/types/v4/locales/{zh-tw.d.ts → kh.d.ts} +0 -3
  39. package/compiled/zod/dist/types/v4/locales/ko.d.ts +0 -3
  40. package/compiled/zod/dist/types/v4/locales/mk.d.ts +0 -3
  41. package/compiled/zod/dist/types/v4/locales/ms.d.ts +0 -3
  42. package/compiled/zod/dist/types/v4/locales/nl.d.ts +4 -0
  43. package/compiled/zod/dist/types/v4/locales/no.d.ts +0 -3
  44. package/compiled/zod/dist/types/v4/locales/ota.d.ts +0 -3
  45. package/compiled/zod/dist/types/v4/locales/pl.d.ts +0 -3
  46. package/compiled/zod/dist/types/v4/locales/pt.d.ts +0 -3
  47. package/compiled/zod/dist/types/v4/locales/ru.d.ts +0 -3
  48. package/compiled/zod/dist/types/v4/locales/sl.d.ts +0 -3
  49. package/compiled/zod/dist/types/v4/locales/sv.d.ts +4 -0
  50. package/compiled/zod/dist/types/v4/locales/ta.d.ts +0 -3
  51. package/compiled/zod/dist/types/v4/locales/th.d.ts +0 -3
  52. package/compiled/zod/dist/types/v4/locales/tr.d.ts +0 -2
  53. package/compiled/zod/dist/types/v4/locales/ua.d.ts +0 -3
  54. package/compiled/zod/dist/types/v4/locales/ur.d.ts +0 -3
  55. package/compiled/zod/dist/types/v4/locales/vi.d.ts +0 -3
  56. package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +0 -3
  57. package/compiled/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
  58. package/compiled/zod/dist/types/v4/mini/external.d.ts +5 -1
  59. package/compiled/zod/dist/types/v4/mini/schemas.d.ts +40 -49
  60. package/compiled/zod/index.js +42 -64
  61. package/compiled/zod/package.json +1 -1
  62. package/compiled/zod/v3/index.d.ts +3 -1
  63. package/compiled/zod/v4/core/index.d.ts +1 -1
  64. package/compiled/zod/v4/index.d.ts +3 -1
  65. package/compiled/zod/v4/locales/index.d.ts +1 -1
  66. package/compiled/zod/v4-mini/index.d.ts +1 -1
  67. package/dist/ErrorHelpers.d.ts +0 -15
  68. package/dist/Module.d.ts +5 -1
  69. package/dist/ModuleTypeConstants.d.ts +0 -85
  70. package/dist/RspackError.d.ts +0 -3
  71. package/dist/builtin-loader/lightningcss/index.d.ts +23 -1
  72. package/dist/builtin-loader/swc/types.d.ts +289 -2426
  73. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  74. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  75. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  76. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  77. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  78. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  79. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  80. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  81. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  82. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  83. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  84. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  85. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  86. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  87. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  88. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  89. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  90. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  91. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  92. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  93. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  94. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  95. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  96. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  97. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  98. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  99. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  100. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  101. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  102. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  103. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  104. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  105. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  106. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  107. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  108. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  109. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  110. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
  111. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  112. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  113. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  114. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  115. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  116. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  117. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  118. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  119. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  120. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  121. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
  122. package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
  123. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  124. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  125. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  126. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  127. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  128. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
  129. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  130. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  131. package/dist/builtin-plugin/base.d.ts +1 -2
  132. package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
  133. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  134. package/dist/config/browserslistTargetHandler.d.ts +0 -6
  135. package/dist/config/zod.d.ts +370 -370
  136. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  137. package/dist/exports.d.ts +1 -0
  138. package/dist/index.js +67 -71
  139. package/dist/lib/AbstractMethodError.d.ts +0 -1
  140. package/dist/lib/CacheFacade.d.ts +0 -28
  141. package/dist/loader-runner/index.d.ts +1 -0
  142. package/dist/stats/statsFactoryUtils.d.ts +24 -4
  143. package/dist/util/cleverMerge.d.ts +0 -30
  144. package/dist/util/comparators.d.ts +0 -4
  145. package/dist/util/hash/wasm-hash.d.ts +0 -1
  146. package/dist/util/identifier.d.ts +0 -12
  147. package/dist/util/index.d.ts +1 -7
  148. package/dist/util/memoize.d.ts +0 -1
  149. package/dist/worker.js +5 -7
  150. package/module.d.ts +53 -21
  151. package/package.json +11 -12
  152. package/compiled/browserslist/index.d.ts +0 -1
  153. package/compiled/browserslist/index.js +0 -2123
  154. package/compiled/browserslist/license +0 -20
  155. package/compiled/browserslist/package.json +0 -1
  156. package/dist/util/hash/BatchedHash.d.ts +0 -25
@@ -1,3 +1,2 @@
1
1
  export declare const memoize: <T>(fn: () => T) => (() => T);
2
2
  export declare const memoizeFn: <const T extends readonly unknown[], const P>(fn: () => (...args: T) => P) => (...args: T) => P;
3
- export declare function memoizeValue<T>(fn: () => T): T;
package/dist/worker.js CHANGED
@@ -4,9 +4,7 @@ var __webpack_modules__ = {
4
4
  __webpack_require__.d(__webpack_exports__, {
5
5
  R_: ()=>cleverMerge
6
6
  });
7
- let DYNAMIC_INFO = Symbol("cleverMerge dynamic info"), mergeCache = new WeakMap();
8
- new WeakMap();
9
- let DELETE = Symbol("DELETE"), cachedCleverMerge = (first, second)=>{
7
+ let DYNAMIC_INFO = Symbol("cleverMerge dynamic info"), mergeCache = new WeakMap(), DELETE = Symbol("DELETE"), cachedCleverMerge = (first, second)=>{
10
8
  if (void 0 === second) return first;
11
9
  if (void 0 === first || "object" != typeof second || null === second) return second;
12
10
  if ("object" != typeof first || null === first) return first;
@@ -209,11 +207,11 @@ var __webpack_modules__ = {
209
207
  this.message = match?.[1] ? createMessage(match[1]) : createMessage();
210
208
  }
211
209
  }
212
- let AbstractMethodError = class extends WebpackError {
210
+ class AbstractMethodError extends WebpackError {
213
211
  constructor(){
214
212
  super(new Message().message), this.name = "AbstractMethodError";
215
213
  }
216
- };
214
+ }
217
215
  class Hash {
218
216
  update(data, inputEncoding) {
219
217
  throw new AbstractMethodError();
@@ -505,7 +503,7 @@ for(var __webpack_i__ in (()=>{
505
503
  };
506
504
  }, cachedFn;
507
505
  };
508
- makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>requestToAbsolute(context, str)).join(""));
506
+ makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join(""));
509
507
  let contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>requestToAbsolute(context, r)).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/;
510
508
  makeCacheable((str)=>{
511
509
  let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
@@ -552,7 +550,7 @@ for(var __webpack_i__ in (()=>{
552
550
  }
553
551
  }
554
552
  function handleResult(loader, module, callback) {
555
- return "function" != typeof module && "object" != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = "function" == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, "function" != typeof loader.normal && "function" != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
553
+ return "function" != typeof module && "object" != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = "function" == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, loader.pitch || (loader.noPitch = !0), "function" != typeof loader.normal && "function" != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
556
554
  }
557
555
  function isWorkerResponseMessage(message) {
558
556
  return "response" === message.type;
package/module.d.ts CHANGED
@@ -9,6 +9,8 @@
9
9
  */
10
10
 
11
11
  declare namespace Rspack {
12
+ type ModuleId = string | number;
13
+
12
14
  type DeclinedEvent =
13
15
  | {
14
16
  type: "declined";
@@ -169,6 +171,49 @@ declare namespace Rspack {
169
171
  id: string | number;
170
172
  (dependency: string): unknown;
171
173
  }
174
+
175
+ interface Module {
176
+ exports: any;
177
+ id: ModuleId;
178
+ loaded: boolean;
179
+ parents: NodeJS.Module["id"][] | null | undefined;
180
+ children: NodeJS.Module["id"][];
181
+ hot?: Hot | undefined;
182
+ }
183
+
184
+ interface RequireResolve {
185
+ (id: string): ModuleId;
186
+ }
187
+
188
+ interface Require {
189
+ (path: string): any;
190
+ <T>(path: string): T;
191
+ (paths: string[], callback: (...modules: any[]) => void): void;
192
+ resolve: NodeJS.RequireResolve;
193
+ ensure(
194
+ dependencies: string[],
195
+ callback: (require: (module: string) => void) => void,
196
+ errorCallback?: (error: Error) => void,
197
+ chunkName?: string
198
+ ): Rspack.Context;
199
+ context(
200
+ request: string,
201
+ includeSubdirectories?: boolean,
202
+ filter?: RegExp,
203
+ mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"
204
+ ): Rspack.Context;
205
+ resolveWeak(dependency: string): void;
206
+ cache: {
207
+ [id: string]: NodeJS.Module | undefined;
208
+ };
209
+ }
210
+
211
+ interface Process {
212
+ env: {
213
+ [key: string]: any;
214
+ NODE_ENV: 'development' | 'production' | (string & {});
215
+ };
216
+ }
172
217
  }
173
218
 
174
219
  interface ImportMeta {
@@ -220,25 +265,12 @@ declare var __non_webpack_require__: (id: any) => unknown;
220
265
  declare const __system_context__: object;
221
266
 
222
267
  declare namespace NodeJS {
223
- interface Module {
224
- hot: Rspack.Hot;
225
- }
226
-
227
- interface Require {
228
- ensure(
229
- dependencies: string[],
230
- callback: (require: (module: string) => void) => void,
231
- errorCallback?: (error: Error) => void,
232
- chunkName?: string
233
- ): void;
234
- context(
235
- request: string,
236
- includeSubdirectories?: boolean,
237
- filter?: RegExp,
238
- mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"
239
- ): Rspack.Context;
240
- include(dependency: string): void;
241
- resolveWeak(dependency: string): void;
242
- onError?: (error: Error) => void;
243
- }
268
+ interface Module extends Rspack.Module {}
269
+ interface Require extends Rspack.Require {}
270
+ interface RequireResolve extends Rspack.RequireResolve {}
271
+ interface Process extends Rspack.Process {}
244
272
  }
273
+
274
+ declare var module: NodeJS.Module;
275
+ declare var require: NodeJS.Require;
276
+ declare var process: NodeJS.Process;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -29,7 +29,7 @@
29
29
  "engines": {
30
30
  "node": ">=16.0.0"
31
31
  },
32
- "homepage": "https://rspack.dev",
32
+ "homepage": "https://rspack.rs",
33
33
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
34
34
  "repository": {
35
35
  "type": "git",
@@ -37,28 +37,27 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@swc/core": "1.11.24",
40
+ "@rslib/core": "0.9.1",
41
+ "@swc/core": "1.11.29",
41
42
  "@swc/types": "0.1.21",
42
- "@rslib/core": "0.8.0",
43
43
  "@types/graceful-fs": "4.1.9",
44
44
  "@types/watchpack": "^2.4.4",
45
- "browserslist": "^4.24.5",
45
+ "browserslist-load-config": "^1.0.0",
46
46
  "enhanced-resolve": "5.18.1",
47
47
  "graceful-fs": "^4.2.11",
48
48
  "prebundle": "^1.3.3",
49
+ "tinypool": "^1.0.2",
49
50
  "tsx": "^4.19.4",
50
51
  "typescript": "^5.8.3",
51
- "watchpack": "^2.4.3",
52
+ "watchpack": "^2.4.4",
52
53
  "webpack-sources": "3.3.0",
53
- "zod": "^3.25.28",
54
- "zod-validation-error": "3.4.1",
55
- "tinypool": "^1.0.2"
54
+ "zod": "^3.25.50",
55
+ "zod-validation-error": "3.4.1"
56
56
  },
57
57
  "dependencies": {
58
- "@module-federation/runtime-tools": "0.14.0",
58
+ "@module-federation/runtime-tools": "0.14.3",
59
59
  "@rspack/lite-tapable": "1.0.1",
60
- "caniuse-lite": "^1.0.30001718",
61
- "@rspack/binding": "1.3.12"
60
+ "@rspack/binding": "1.3.14"
62
61
  },
63
62
  "peerDependencies": {
64
63
  "@swc/helpers": ">=0.5.1"
@@ -1 +0,0 @@
1
- export = any;