@rspack-canary/core 1.6.6-canary-e2b38893-20251127173453 → 1.6.6-canary-58385907-20251128173403
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.
- package/dist/config/types.d.ts +12 -1
- package/dist/index.js +11 -11
- package/dist/loader-runner/index.d.ts +3 -1
- package/dist/loader-runner/service.d.ts +2 -0
- package/package.json +2 -2
package/dist/config/types.d.ts
CHANGED
|
@@ -634,7 +634,18 @@ export type RuleSetLoaderOptions = string | Record<string, any>;
|
|
|
634
634
|
export type RuleSetLoaderWithOptions = {
|
|
635
635
|
ident?: string;
|
|
636
636
|
loader: RuleSetLoader;
|
|
637
|
-
|
|
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
|
+
};
|
|
638
649
|
options?: RuleSetLoaderOptions;
|
|
639
650
|
};
|
|
640
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;
|
|
@@ -5785,7 +5785,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5785
5785
|
}, applyExperimentsDefaults = (experiments, { development })=>{
|
|
5786
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);
|
|
5787
5787
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
5788
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.6-canary-
|
|
5788
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.6-canary-58385907-20251128173403"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
|
5789
5789
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
|
|
5790
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 })=>{
|
|
5791
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", [
|
|
@@ -7438,7 +7438,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7438
7438
|
});
|
|
7439
7439
|
}
|
|
7440
7440
|
}
|
|
7441
|
-
let CORE_VERSION = "1.6.6-canary-
|
|
7441
|
+
let CORE_VERSION = "1.6.6-canary-58385907-20251128173403", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
|
7442
7442
|
|
|
7443
7443
|
Help:
|
|
7444
7444
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
|
@@ -8739,7 +8739,7 @@ Help:
|
|
|
8739
8739
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8740
8740
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8741
8741
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8742
|
-
}), childOptions.version && (obj.rspackVersion = "1.6.6-canary-
|
|
8742
|
+
}), childOptions.version && (obj.rspackVersion = "1.6.6-canary-58385907-20251128173403", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
|
8743
8743
|
let mapError = (j, obj)=>({
|
|
8744
8744
|
...obj,
|
|
8745
8745
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -9638,7 +9638,7 @@ Help:
|
|
|
9638
9638
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9639
9639
|
},
|
|
9640
9640
|
version: (object)=>{
|
|
9641
|
-
object.version = "5.75.0", object.rspackVersion = "1.6.6-canary-
|
|
9641
|
+
object.version = "5.75.0", object.rspackVersion = "1.6.6-canary-58385907-20251128173403";
|
|
9642
9642
|
},
|
|
9643
9643
|
env: (object, _compilation, _context, { _env })=>{
|
|
9644
9644
|
object.env = _env;
|
|
@@ -11857,7 +11857,7 @@ Help:
|
|
|
11857
11857
|
let _options = JSON.stringify(options || {});
|
|
11858
11858
|
return binding_default().transform(source, _options);
|
|
11859
11859
|
}
|
|
11860
|
-
let exports_rspackVersion = "1.6.6-canary-
|
|
11860
|
+
let exports_rspackVersion = "1.6.6-canary-58385907-20251128173403", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
|
11861
11861
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
11862
11862
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
11863
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/core",
|
|
3
|
-
"version": "1.6.6-canary-
|
|
3
|
+
"version": "1.6.6-canary-58385907-20251128173403",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@module-federation/runtime-tools": "0.21.6",
|
|
60
60
|
"@rspack/lite-tapable": "1.1.0",
|
|
61
|
-
"@rspack/binding": "npm:@rspack-canary/binding@1.6.6-canary-
|
|
61
|
+
"@rspack/binding": "npm:@rspack-canary/binding@1.6.6-canary-58385907-20251128173403"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@swc/helpers": ">=0.5.1"
|