@rspack/browser 1.6.5 → 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.
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +23 -3
- package/dist/index.mjs +52 -17
- package/dist/loader-runner/index.d.ts +3 -1
- package/dist/loader-runner/service.d.ts +2 -0
- package/dist/napi-binding.d.ts +1 -0
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/package.json +1 -1
package/dist/config/target.d.ts
CHANGED
|
@@ -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 */
|
package/dist/config/types.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
299
|
-
*
|
|
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
|
-
|
|
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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see index.mjs.LICENSE.txt */
|
|
2
|
-
import * as
|
|
2
|
+
import * as __rspack_external__rspack_wasi_browser_js_bd433424 from "./rspack.wasi-browser.js";
|
|
3
3
|
import { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, AsyncSeriesWaterfallHook, HookMap, MultiHook, SyncBailHook, SyncHook, SyncWaterfallHook, maxStage, minStage, safeStage } from "@rspack/lite-tapable";
|
|
4
4
|
var __webpack_modules__ = {
|
|
5
5
|
"../../node_modules/.pnpm/asn1.js@4.10.1/node_modules/asn1.js/lib/asn1.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
@@ -35312,14 +35312,14 @@ var __webpack_modules__ = {
|
|
|
35312
35312
|
"./src/browser/buffer.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
35313
35313
|
__webpack_require__.r(__webpack_exports__);
|
|
35314
35314
|
__webpack_require__.d(__webpack_exports__, {
|
|
35315
|
-
Buffer: ()=>
|
|
35315
|
+
Buffer: ()=>_napi_rs_wasm_runtime_fs__rspack_import_0.hp
|
|
35316
35316
|
});
|
|
35317
|
-
var
|
|
35317
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35318
35318
|
},
|
|
35319
35319
|
"./src/browser/fs.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
35320
35320
|
__webpack_require__.r(__webpack_exports__);
|
|
35321
35321
|
__webpack_require__.d(__webpack_exports__, {
|
|
35322
|
-
default: ()=>
|
|
35322
|
+
default: ()=>__rspack_default_export,
|
|
35323
35323
|
existsSync: ()=>existsSync,
|
|
35324
35324
|
fs: ()=>fs,
|
|
35325
35325
|
lstat: ()=>lstat,
|
|
@@ -35330,16 +35330,16 @@ var __webpack_modules__ = {
|
|
|
35330
35330
|
volume: ()=>volume,
|
|
35331
35331
|
watch: ()=>watch
|
|
35332
35332
|
});
|
|
35333
|
-
var
|
|
35334
|
-
var
|
|
35335
|
-
const fs =
|
|
35336
|
-
const volume =
|
|
35337
|
-
const memfs =
|
|
35333
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35334
|
+
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding");
|
|
35335
|
+
const fs = _rspack_binding__rspack_import_1.__fs;
|
|
35336
|
+
const volume = _rspack_binding__rspack_import_1.__volume;
|
|
35337
|
+
const memfs = _napi_rs_wasm_runtime_fs__rspack_import_0.tO;
|
|
35338
35338
|
const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
|
|
35339
|
-
const
|
|
35339
|
+
const __rspack_default_export = fs;
|
|
35340
35340
|
},
|
|
35341
35341
|
"@rspack/binding": function(module1) {
|
|
35342
|
-
module1.exports =
|
|
35342
|
+
module1.exports = __rspack_external__rspack_wasi_browser_js_bd433424;
|
|
35343
35343
|
},
|
|
35344
35344
|
"?4fc0": function() {},
|
|
35345
35345
|
"?dcfb": function() {},
|
|
@@ -55126,7 +55126,7 @@ async function runLoaders(compiler, context) {
|
|
|
55126
55126
|
loaderContext: getWorkerLoaderContext(),
|
|
55127
55127
|
loaderState,
|
|
55128
55128
|
args
|
|
55129
|
-
}, getWorkerLoaderHandlers()) || [];
|
|
55129
|
+
}, getWorkerLoaderHandlers(), "object" == typeof currentLoaderObject?.parallel ? currentLoaderObject.parallel : void 0) || [];
|
|
55130
55130
|
else {
|
|
55131
55131
|
if (loaderState === external_rspack_wasi_browser_js_.JsLoaderState.Normal) convertArgs(args, !!currentLoaderObject?.raw);
|
|
55132
55132
|
result = await utils_runSyncOrAsync(fn, loaderContext, args) || [];
|
|
@@ -55355,6 +55355,7 @@ function getRawOutput(output) {
|
|
|
55355
55355
|
function getRawOutputEnvironment(environment = {}) {
|
|
55356
55356
|
return {
|
|
55357
55357
|
const: Boolean(environment.const),
|
|
55358
|
+
methodShorthand: Boolean(environment.methodShorthand),
|
|
55358
55359
|
arrowFunction: Boolean(environment.arrowFunction),
|
|
55359
55360
|
nodePrefixForCoreModules: Boolean(environment.nodePrefixForCoreModules),
|
|
55360
55361
|
asyncFunction: Boolean(environment.asyncFunction),
|
|
@@ -57486,6 +57487,35 @@ const browserslistTargetHandler_resolve = (browsers)=>{
|
|
|
57486
57487
|
0
|
|
57487
57488
|
]
|
|
57488
57489
|
}),
|
|
57490
|
+
methodShorthand: rawChecker({
|
|
57491
|
+
chrome: 47,
|
|
57492
|
+
and_chr: 47,
|
|
57493
|
+
edge: 12,
|
|
57494
|
+
firefox: 34,
|
|
57495
|
+
and_ff: 34,
|
|
57496
|
+
opera: 34,
|
|
57497
|
+
op_mob: 34,
|
|
57498
|
+
safari: 9,
|
|
57499
|
+
ios_saf: 9,
|
|
57500
|
+
samsung: 5,
|
|
57501
|
+
android: 47,
|
|
57502
|
+
and_qq: [
|
|
57503
|
+
14,
|
|
57504
|
+
9
|
|
57505
|
+
],
|
|
57506
|
+
and_uc: [
|
|
57507
|
+
15,
|
|
57508
|
+
5
|
|
57509
|
+
],
|
|
57510
|
+
kaios: [
|
|
57511
|
+
2,
|
|
57512
|
+
5
|
|
57513
|
+
],
|
|
57514
|
+
node: [
|
|
57515
|
+
4,
|
|
57516
|
+
9
|
|
57517
|
+
]
|
|
57518
|
+
}),
|
|
57489
57519
|
arrowFunction: rawChecker({
|
|
57490
57520
|
chrome: 45,
|
|
57491
57521
|
and_chr: 45,
|
|
@@ -57883,6 +57913,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
57883
57913
|
const: v(6),
|
|
57884
57914
|
templateLiteral: v(4),
|
|
57885
57915
|
optionalChaining: v(14),
|
|
57916
|
+
methodShorthand: v(4),
|
|
57886
57917
|
arrowFunction: v(6),
|
|
57887
57918
|
asyncFunction: v(7, 6),
|
|
57888
57919
|
forOf: v(5),
|
|
@@ -57922,6 +57953,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
57922
57953
|
const: v(1, 1),
|
|
57923
57954
|
templateLiteral: v(1, 1),
|
|
57924
57955
|
optionalChaining: v(8),
|
|
57956
|
+
methodShorthand: v(1, 1),
|
|
57925
57957
|
arrowFunction: v(1, 1),
|
|
57926
57958
|
asyncFunction: v(1, 7),
|
|
57927
57959
|
forOf: v(0, 36),
|
|
@@ -57957,6 +57989,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
57957
57989
|
const: v(0, 15),
|
|
57958
57990
|
templateLiteral: v(0, 13),
|
|
57959
57991
|
optionalChaining: v(0, 44),
|
|
57992
|
+
methodShorthand: v(0, 15),
|
|
57960
57993
|
arrowFunction: v(0, 15),
|
|
57961
57994
|
asyncFunction: v(0, 21),
|
|
57962
57995
|
forOf: v(0, 13),
|
|
@@ -57979,6 +58012,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
57979
58012
|
const: v >= 2015,
|
|
57980
58013
|
templateLiteral: v >= 2015,
|
|
57981
58014
|
optionalChaining: v >= 2020,
|
|
58015
|
+
methodShorthand: v >= 2015,
|
|
57982
58016
|
arrowFunction: v >= 2015,
|
|
57983
58017
|
forOf: v >= 2015,
|
|
57984
58018
|
destructuring: v >= 2015,
|
|
@@ -58156,7 +58190,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
|
58156
58190
|
if ("object" == typeof rspackFuture) {
|
|
58157
58191
|
D(rspackFuture, "bundlerInfo", {});
|
|
58158
58192
|
if ("object" == typeof rspackFuture.bundlerInfo) {
|
|
58159
|
-
D(rspackFuture.bundlerInfo, "version", "1.6.
|
|
58193
|
+
D(rspackFuture.bundlerInfo, "version", "1.6.6");
|
|
58160
58194
|
D(rspackFuture.bundlerInfo, "bundler", "rspack");
|
|
58161
58195
|
D(rspackFuture.bundlerInfo, "force", !library);
|
|
58162
58196
|
}
|
|
@@ -58400,6 +58434,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
|
|
|
58400
58434
|
F(environment, "globalThis", ()=>tp?.globalThis);
|
|
58401
58435
|
F(environment, "bigIntLiteral", ()=>tp && optimistic(tp.bigIntLiteral));
|
|
58402
58436
|
F(environment, "const", ()=>tp && optimistic(tp.const));
|
|
58437
|
+
F(environment, "methodShorthand", ()=>tp && optimistic(tp.methodShorthand));
|
|
58403
58438
|
F(environment, "arrowFunction", ()=>tp && optimistic(tp.arrowFunction));
|
|
58404
58439
|
F(environment, "asyncFunction", ()=>tp && optimistic(tp.asyncFunction));
|
|
58405
58440
|
F(environment, "forOf", ()=>tp && optimistic(tp.forOf));
|
|
@@ -58444,7 +58479,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
|
|
|
58444
58479
|
D(output, "webassemblyModuleFilename", "[hash].module.wasm");
|
|
58445
58480
|
D(output, "compareBeforeEmit", true);
|
|
58446
58481
|
F(output, "path", ()=>path_browserify_default().join(defaults_process.cwd(), "dist"));
|
|
58447
|
-
F(output, "pathinfo", ()=>
|
|
58482
|
+
F(output, "pathinfo", ()=>false);
|
|
58448
58483
|
D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : "");
|
|
58449
58484
|
D(output, "hashFunction", "xxhash64");
|
|
58450
58485
|
D(output, "hashDigest", "hex");
|
|
@@ -62105,7 +62140,7 @@ class MultiStats {
|
|
|
62105
62140
|
return obj;
|
|
62106
62141
|
});
|
|
62107
62142
|
if (childOptions.version) {
|
|
62108
|
-
obj.rspackVersion = "1.6.
|
|
62143
|
+
obj.rspackVersion = "1.6.6";
|
|
62109
62144
|
obj.version = "5.75.0";
|
|
62110
62145
|
}
|
|
62111
62146
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
|
|
@@ -63410,7 +63445,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
63410
63445
|
},
|
|
63411
63446
|
version: (object)=>{
|
|
63412
63447
|
object.version = "5.75.0";
|
|
63413
|
-
object.rspackVersion = "1.6.
|
|
63448
|
+
object.rspackVersion = "1.6.6";
|
|
63414
63449
|
},
|
|
63415
63450
|
env: (object, _compilation, _context, { _env })=>{
|
|
63416
63451
|
object.env = _env;
|
|
@@ -66547,7 +66582,7 @@ function transformSync(source, options) {
|
|
|
66547
66582
|
const _options = JSON.stringify(options || {});
|
|
66548
66583
|
return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
|
|
66549
66584
|
}
|
|
66550
|
-
const exports_rspackVersion = "1.6.
|
|
66585
|
+
const exports_rspackVersion = "1.6.6";
|
|
66551
66586
|
const exports_version = "5.75.0";
|
|
66552
66587
|
const exports_WebpackError = Error;
|
|
66553
66588
|
const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
|
|
@@ -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/napi-binding.d.ts
CHANGED
|
Binary file
|
package/package.json
CHANGED