@rspack/core 1.6.4 → 1.6.6

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.
@@ -78,7 +78,7 @@ declare class Watchpack extends EventEmitter {
78
78
  aggregatedChanges: Set<string>;
79
79
  aggregatedRemovals: Set<string>;
80
80
 
81
- aggregateTimeout: NodeJS.Timer;
81
+ aggregateTimeout: number;
82
82
  dirWatchers: Watcher[];
83
83
  fileWatchers: Watcher[];
84
84
  /** Last modified times for files by path */
@@ -14,6 +14,7 @@ export declare const RuntimePluginImpl: {
14
14
  };
15
15
  export type RuntimePluginHooks = {
16
16
  createScript: liteTapable.SyncWaterfallHook<[string, Chunk]>;
17
+ createLink: liteTapable.SyncWaterfallHook<[string, Chunk]>;
17
18
  linkPreload: liteTapable.SyncWaterfallHook<[string, Chunk]>;
18
19
  linkPrefetch: liteTapable.SyncWaterfallHook<[string, Chunk]>;
19
20
  };
@@ -50,6 +50,8 @@ export type EcmaTargetProperties = {
50
50
  bigIntLiteral: boolean | null;
51
51
  /** const and let variable declarations are available */
52
52
  const: boolean | null;
53
+ /** method shorthand in object is available */
54
+ methodShorthand: boolean | null;
53
55
  /** arrow functions are available */
54
56
  arrowFunction: boolean | null;
55
57
  /** for of iteration is available */
@@ -276,6 +276,8 @@ export type Environment = {
276
276
  forOf?: boolean;
277
277
  /** The environment supports 'globalThis'. */
278
278
  globalThis?: boolean;
279
+ /** The environment supports { fn() {} } */
280
+ methodShorthand?: boolean;
279
281
  /** The environment supports ECMAScript Module syntax to import ECMAScript modules (import ... from '...'). */
280
282
  module?: boolean;
281
283
  /**
@@ -295,8 +297,15 @@ export type Output = {
295
297
  * */
296
298
  path?: Path;
297
299
  /**
298
- * Tells Rspack to include comments in bundles with information about the contained modules.
299
- * @default true
300
+ * Controls whether Rspack adds module-related comments to the generated bundle.
301
+ * These comments are useful for debugging, inspecting build output, and understanding
302
+ * tree-shaking behavior.
303
+ * - `true`: Enables basic comments, including module path information.
304
+ * - `false`: Disables all comments, which is the default behavior.
305
+ * - `'verbose'`: Outputs detailed comments, such as module exports, runtime details,
306
+ * tree-shaking information, and bailout reasons. This mode is helpful when diagnosing
307
+ * build issues or performing in-depth bundle analysis.
308
+ * @default false
300
309
  */
301
310
  pathinfo?: Pathinfo;
302
311
  /**
@@ -625,7 +634,18 @@ export type RuleSetLoaderOptions = string | Record<string, any>;
625
634
  export type RuleSetLoaderWithOptions = {
626
635
  ident?: string;
627
636
  loader: RuleSetLoader;
628
- parallel?: boolean;
637
+ /**
638
+ * Controls whether a given loader should run in worker threads for parallel execution. Loaders marked
639
+ * with `parallel` are scheduled across multiple threads, reducing pressure on the main thread and improving
640
+ * overall build performance.
641
+ * - When set to `true`, the loader runs in a worker. Rspack automatically selects an appropriate number of
642
+ * worker threads.
643
+ * - When set to `{ maxWorkers }`, you can explicitly define the maximum number of workers to use.
644
+ * - When set to `false` or omitted, the loader runs on the main thread.
645
+ */
646
+ parallel?: boolean | {
647
+ maxWorkers?: number;
648
+ };
629
649
  options?: RuleSetLoaderOptions;
630
650
  };
631
651
  export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
package/dist/index.js CHANGED
@@ -2945,13 +2945,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2945
2945
  super(ModuleError_createMessage(err, "Warning", from)), this.name = "ModuleWarning", this.error = err, this.details = getErrorDetails(err);
2946
2946
  }
2947
2947
  }
2948
- let ensureLoaderWorkerPool = async ()=>service_pool || (service_pool = import("../compiled/tinypool/dist/index.js").then(({ Tinypool })=>{
2949
- let availableThreads = Math.max(__webpack_require__("node:os").cpus().length - 1, 1);
2948
+ let ensureLoaderWorkerPool = async (workerOptions)=>service_pool || (service_pool = import("../compiled/tinypool/dist/index.js").then(({ Tinypool })=>{
2949
+ let availableThreads = Math.max(__webpack_require__("node:os").cpus().length - 1, 1), maxWorkers = workerOptions?.maxWorkers ? Math.max(workerOptions.maxWorkers, 1) : void 0;
2950
2950
  return new Tinypool({
2951
2951
  filename: external_node_path_default().resolve(__dirname, "worker.js"),
2952
2952
  useAtomics: !1,
2953
- maxThreads: availableThreads,
2954
- minThreads: availableThreads,
2953
+ maxThreads: maxWorkers || availableThreads,
2954
+ minThreads: maxWorkers || availableThreads,
2955
2955
  concurrentTasksPerWorker: 1
2956
2956
  });
2957
2957
  }));
@@ -2968,7 +2968,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2968
2968
  };
2969
2969
  throw Error("Failed to serialize error, only string, Error instances and objects with a message property are supported");
2970
2970
  }
2971
- let service_run = async (loaderName, task, options)=>ensureLoaderWorkerPool().then(async (pool)=>{
2971
+ let service_run = async (loaderName, task, options, workerOptions)=>ensureLoaderWorkerPool(workerOptions).then(async (pool)=>{
2972
2972
  let { MessageChannel } = await import("node:worker_threads"), { port1: mainPort, port2: workerPort } = new MessageChannel(), { port1: mainSyncPort, port2: workerSyncPort } = new MessageChannel();
2973
2973
  return new Promise((resolve, reject)=>{
2974
2974
  let handleError = (error)=>{
@@ -3589,7 +3589,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3589
3589
  throw Error(`Unknown request type: ${requestType}`);
3590
3590
  }
3591
3591
  }
3592
- }) || [];
3592
+ }, "object" == typeof currentLoaderObject?.parallel ? currentLoaderObject.parallel : void 0) || [];
3593
3593
  } else loaderState === binding_.JsLoaderState.Normal && function(args, raw) {
3594
3594
  if (!raw && args[0] instanceof Uint8Array) {
3595
3595
  var buf;
@@ -4555,6 +4555,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4555
4555
  "code",
4556
4556
  "chunk"
4557
4557
  ]),
4558
+ createLink: new lite_tapable_namespaceObject.SyncWaterfallHook([
4559
+ "code",
4560
+ "chunk"
4561
+ ]),
4558
4562
  linkPreload: new lite_tapable_namespaceObject.SyncWaterfallHook([
4559
4563
  "code",
4560
4564
  "chunk"
@@ -4641,7 +4645,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4641
4645
  return createBuiltinPlugin(this.name, rawOptions);
4642
4646
  }
4643
4647
  }
4644
- let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
4648
+ let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", HTTP_PROTOCOL_REGEX = /^https?:/, NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
4645
4649
  let htmlPlugin = "Disabled";
4646
4650
  return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
4647
4651
  hashFuncNames: options.hashFuncNames,
@@ -4702,7 +4706,23 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4702
4706
  }
4703
4707
  }(tag);
4704
4708
  if (!tagSrc) return;
4705
- let src = (0, external_node_path_namespaceObject.relative)(publicPath, decodeURIComponent(tagSrc));
4709
+ let isUrlSrc = !1;
4710
+ try {
4711
+ let url = new URL(tagSrc);
4712
+ isUrlSrc = "http:" === url.protocol || "https:" === url.protocol;
4713
+ } catch (_) {
4714
+ isUrlSrc = tagSrc.startsWith("//");
4715
+ }
4716
+ let src = "";
4717
+ if (isUrlSrc) {
4718
+ if (!publicPath) return;
4719
+ let protocolRelativePublicPath = publicPath.replace(HTTP_PROTOCOL_REGEX, ""), protocolRelativeTagSrc = tagSrc.replace(HTTP_PROTOCOL_REGEX, "");
4720
+ if (!protocolRelativeTagSrc.startsWith(protocolRelativePublicPath)) return;
4721
+ {
4722
+ let tagSrcWithScheme = `http:${protocolRelativeTagSrc}`, publicPathWithScheme = protocolRelativePublicPath.startsWith("//") ? `http:${protocolRelativePublicPath}` : protocolRelativePublicPath;
4723
+ src = (0, external_node_path_namespaceObject.relative)(publicPathWithScheme, decodeURIComponent(tagSrcWithScheme));
4724
+ }
4725
+ } else src = (0, external_node_path_namespaceObject.relative)(publicPath, decodeURIComponent(tagSrc));
4706
4726
  tag.attributes.integrity = this.getIntegrityChecksumForAsset(src) || function(hashFuncNames, source) {
4707
4727
  let { createHash } = __webpack_require__("node:crypto");
4708
4728
  return hashFuncNames.map((hashFuncName)=>`${hashFuncName}-${createHash(hashFuncName).update("string" == typeof source ? Buffer.from(source, "utf-8") : source).digest("base64")}`).join(" ");
@@ -5153,6 +5173,35 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5153
5173
  0
5154
5174
  ]
5155
5175
  }),
5176
+ methodShorthand: rawChecker({
5177
+ chrome: 47,
5178
+ and_chr: 47,
5179
+ edge: 12,
5180
+ firefox: 34,
5181
+ and_ff: 34,
5182
+ opera: 34,
5183
+ op_mob: 34,
5184
+ safari: 9,
5185
+ ios_saf: 9,
5186
+ samsung: 5,
5187
+ android: 47,
5188
+ and_qq: [
5189
+ 14,
5190
+ 9
5191
+ ],
5192
+ and_uc: [
5193
+ 15,
5194
+ 5
5195
+ ],
5196
+ kaios: [
5197
+ 2,
5198
+ 5
5199
+ ],
5200
+ node: [
5201
+ 4,
5202
+ 9
5203
+ ]
5204
+ }),
5156
5205
  arrowFunction: rawChecker({
5157
5206
  chrome: 45,
5158
5207
  and_chr: 45,
@@ -5541,6 +5590,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5541
5590
  const: v(6),
5542
5591
  templateLiteral: v(4),
5543
5592
  optionalChaining: v(14),
5593
+ methodShorthand: v(4),
5544
5594
  arrowFunction: v(6),
5545
5595
  asyncFunction: v(7, 6),
5546
5596
  forOf: v(5),
@@ -5580,6 +5630,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5580
5630
  const: v(1, 1),
5581
5631
  templateLiteral: v(1, 1),
5582
5632
  optionalChaining: v(8),
5633
+ methodShorthand: v(1, 1),
5583
5634
  arrowFunction: v(1, 1),
5584
5635
  asyncFunction: v(1, 7),
5585
5636
  forOf: v(0, 36),
@@ -5615,6 +5666,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5615
5666
  const: v(0, 15),
5616
5667
  templateLiteral: v(0, 13),
5617
5668
  optionalChaining: v(0, 44),
5669
+ methodShorthand: v(0, 15),
5618
5670
  arrowFunction: v(0, 15),
5619
5671
  asyncFunction: v(0, 21),
5620
5672
  forOf: v(0, 13),
@@ -5636,6 +5688,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5636
5688
  const: v >= 2015,
5637
5689
  templateLiteral: v >= 2015,
5638
5690
  optionalChaining: v >= 2020,
5691
+ methodShorthand: v >= 2015,
5639
5692
  arrowFunction: v >= 2015,
5640
5693
  forOf: v >= 2015,
5641
5694
  destructuring: v >= 2015,
@@ -5732,7 +5785,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5732
5785
  }, applyExperimentsDefaults = (experiments, { development })=>{
5733
5786
  F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
5734
5787
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5735
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.4"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5788
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.6"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5736
5789
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5737
5790
  if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { usedExports, inlineConst, deferImport })=>{
5738
5791
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
@@ -5889,6 +5942,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5889
5942
  }), F(environment, "const", ()=>{
5890
5943
  let v;
5891
5944
  return tp && ((v = tp.const) || void 0 === v);
5945
+ }), F(environment, "methodShorthand", ()=>{
5946
+ let v;
5947
+ return tp && ((v = tp.methodShorthand) || void 0 === v);
5892
5948
  }), F(environment, "arrowFunction", ()=>{
5893
5949
  let v;
5894
5950
  return tp && ((v = tp.arrowFunction) || void 0 === v);
@@ -5928,7 +5984,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5928
5984
  return "function" != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1") : "[id].css";
5929
5985
  }), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`), F(output, "hotUpdateMainFilename", ()=>`[runtime].[fullhash].hot-update.${output.module ? "json.mjs" : "json"}`);
5930
5986
  let uniqueNameId = Template.toIdentifier(output.uniqueName);
5931
- F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), F(output, "pathinfo", ()=>development), D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && F(output.library, "type", ()=>output.module ? "module" : "var"), F(output, "chunkFormat", ()=>{
5987
+ F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), F(output, "pathinfo", ()=>!1), D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && F(output.library, "type", ()=>output.module ? "module" : "var"), F(output, "chunkFormat", ()=>{
5932
5988
  if (tp) {
5933
5989
  let helpMessage = isAffectedByBrowserslist ? "Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly." : "Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.";
5934
5990
  if (output.module) {
@@ -7382,7 +7438,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7382
7438
  });
7383
7439
  }
7384
7440
  }
7385
- let CORE_VERSION = "1.6.4", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7441
+ let CORE_VERSION = "1.6.6", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7386
7442
 
7387
7443
  Help:
7388
7444
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -7974,6 +8030,7 @@ Help:
7974
8030
  environment: function(environment = {}) {
7975
8031
  return {
7976
8032
  const: !!environment.const,
8033
+ methodShorthand: !!environment.methodShorthand,
7977
8034
  arrowFunction: !!environment.arrowFunction,
7978
8035
  nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
7979
8036
  asyncFunction: !!environment.asyncFunction,
@@ -8498,6 +8555,13 @@ Help:
8498
8555
  return queried.call(data.code, data.chunk);
8499
8556
  };
8500
8557
  }),
8558
+ registerRuntimePluginCreateLinkTaps: createTap5(binding_default().RegisterJsTapKind.RuntimePluginCreateLink, function() {
8559
+ return RuntimePlugin.getCompilationHooks(getCompiler6().__internal__get_compilation()).createLink;
8560
+ }, function(queried) {
8561
+ return function(data) {
8562
+ return queried.call(data.code, data.chunk);
8563
+ };
8564
+ }),
8501
8565
  registerRuntimePluginLinkPreloadTaps: createTap5(binding_default().RegisterJsTapKind.RuntimePluginLinkPreload, function() {
8502
8566
  return RuntimePlugin.getCompilationHooks(getCompiler6().__internal__get_compilation()).linkPreload;
8503
8567
  }, function(queried) {
@@ -8675,7 +8739,7 @@ Help:
8675
8739
  obj.children = this.stats.map((stat, idx)=>{
8676
8740
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8677
8741
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8678
- }), childOptions.version && (obj.rspackVersion = "1.6.4", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8742
+ }), childOptions.version && (obj.rspackVersion = "1.6.6", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8679
8743
  let mapError = (j, obj)=>({
8680
8744
  ...obj,
8681
8745
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9574,7 +9638,7 @@ Help:
9574
9638
  object.hash = context.getStatsCompilation(compilation).hash;
9575
9639
  },
9576
9640
  version: (object)=>{
9577
- object.version = "5.75.0", object.rspackVersion = "1.6.4";
9641
+ object.version = "5.75.0", object.rspackVersion = "1.6.6";
9578
9642
  },
9579
9643
  env: (object, _compilation, _context, { _env })=>{
9580
9644
  object.env = _env;
@@ -11793,7 +11857,7 @@ Help:
11793
11857
  let _options = JSON.stringify(options || {});
11794
11858
  return binding_default().transform(source, _options);
11795
11859
  }
11796
- let exports_rspackVersion = "1.6.4", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11860
+ let exports_rspackVersion = "1.6.6", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11797
11861
  getNormalizedRspackOptions: getNormalizedRspackOptions,
11798
11862
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
11799
11863
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -11,7 +11,9 @@ export declare class LoaderObject {
11
11
  pitch?: Function;
12
12
  raw?: boolean;
13
13
  type?: "module" | "commonjs";
14
- parallel?: boolean;
14
+ parallel?: boolean | {
15
+ maxWorkers?: number;
16
+ };
15
17
  /**
16
18
  * @internal This field is rspack internal. Do not edit.
17
19
  */
@@ -67,5 +67,7 @@ export type WorkerError = Error;
67
67
  export declare function serializeError(error: unknown): WorkerError;
68
68
  export declare const run: (loaderName: string, task: any, options: RunOptions & {
69
69
  handleIncomingRequest: HandleIncomingRequest;
70
+ }, workerOptions?: {
71
+ maxWorkers?: number;
70
72
  }) => Promise<WorkerArgs>;
71
73
  export {};
package/dist/worker.js CHANGED
@@ -7,22 +7,22 @@ var __webpack_modules__ = {
7
7
  transform: ()=>transform,
8
8
  transformSync: ()=>transformSync
9
9
  });
10
- var _rspack_binding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rspack/binding"), _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_rspack_binding__WEBPACK_IMPORTED_MODULE_0__);
10
+ var _rspack_binding__rspack_import_0 = __webpack_require__("@rspack/binding"), _rspack_binding__rspack_import_0_default = __webpack_require__.n(_rspack_binding__rspack_import_0);
11
11
  async function minify(source, options) {
12
12
  let _options = JSON.stringify(options || {});
13
- return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().minify(source, _options);
13
+ return _rspack_binding__rspack_import_0_default().minify(source, _options);
14
14
  }
15
15
  function minifySync(source, options) {
16
16
  let _options = JSON.stringify(options || {});
17
- return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().minifySync(source, _options);
17
+ return _rspack_binding__rspack_import_0_default().minifySync(source, _options);
18
18
  }
19
19
  async function transform(source, options) {
20
20
  let _options = JSON.stringify(options || {});
21
- return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().transform(source, _options);
21
+ return _rspack_binding__rspack_import_0_default().transform(source, _options);
22
22
  }
23
23
  function transformSync(source, options) {
24
24
  let _options = JSON.stringify(options || {});
25
- return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().transformSync(source, _options);
25
+ return _rspack_binding__rspack_import_0_default().transformSync(source, _options);
26
26
  }
27
27
  },
28
28
  "./src/util/cleverMerge.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,13 +37,13 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.39.9",
40
+ "@ast-grep/napi": "^0.40.0",
41
41
  "@napi-rs/wasm-runtime": "1.0.7",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
43
- "@rslib/core": "0.17.1",
43
+ "@rslib/core": "0.18.2",
44
44
  "@swc/types": "0.1.25",
45
45
  "@types/node": "^20.19.25",
46
- "@types/watchpack": "^2.4.4",
46
+ "@types/watchpack": "^2.4.5",
47
47
  "browserslist-load-config": "^1.0.1",
48
48
  "enhanced-resolve": "5.18.3",
49
49
  "glob-to-regexp": "^0.4.1",
@@ -56,9 +56,9 @@
56
56
  "webpack-sources": "3.3.3"
57
57
  },
58
58
  "dependencies": {
59
- "@module-federation/runtime-tools": "0.21.4",
59
+ "@module-federation/runtime-tools": "0.21.6",
60
60
  "@rspack/lite-tapable": "1.1.0",
61
- "@rspack/binding": "1.6.4"
61
+ "@rspack/binding": "1.6.6"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"