@rspack-debug/core 2.0.4 → 2.0.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/compiled/@rspack/lite-tapable/dist/index.d.ts +4 -4
- package/compiled/@rspack/lite-tapable/package.json +1 -1
- package/compiled/connect-next/package.json +1 -1
- package/dist/612.js +32 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +11 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -1
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +42 -0
- package/dist/exports.d.ts +2 -1
- package/dist/index.js +182 -123
- package/dist/worker.js +1 -18
- package/module.d.ts +20 -0
- package/package.json +12 -12
|
@@ -18,9 +18,9 @@ export type AsArray<T> = T extends any[] ? T : [T];
|
|
|
18
18
|
export type Fn<T, R> = (...args: AsArray<T>) => R;
|
|
19
19
|
export type FnAsync<T, R> = (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void;
|
|
20
20
|
export type FnPromise<T, R> = (...args: AsArray<T>) => Promise<R>;
|
|
21
|
-
|
|
21
|
+
type UnsetAdditionalOptions = {
|
|
22
22
|
_UnsetAdditionalOptions: true;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
type IfSet<X> = X extends UnsetAdditionalOptions ? {} : X;
|
|
25
25
|
export type Callback<E, T> = (error: E | null, result?: T) => void;
|
|
26
26
|
type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
|
|
@@ -36,7 +36,7 @@ type TapOptions = {
|
|
|
36
36
|
stage?: number;
|
|
37
37
|
};
|
|
38
38
|
export type Options<AdditionalOptions = UnsetAdditionalOptions> = string | (Tap & IfSet<AdditionalOptions>);
|
|
39
|
-
export interface HookInterceptor<
|
|
39
|
+
export interface HookInterceptor<_T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
40
40
|
name?: string;
|
|
41
41
|
tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
|
|
42
42
|
call?: (...args: any[]) => void;
|
|
@@ -76,7 +76,7 @@ export declare class HookBase<T, R, AdditionalOptions = UnsetAdditionalOptions>
|
|
|
76
76
|
withOptions(options: TapOptions & IfSet<AdditionalOptions>): Hook<T, R, AdditionalOptions>;
|
|
77
77
|
isUsed(): boolean;
|
|
78
78
|
queryStageRange(stageRange: StageRange): QueriedHook<T, R, AdditionalOptions>;
|
|
79
|
-
callAsyncStageRange(
|
|
79
|
+
callAsyncStageRange(_queried: QueriedHook<T, R, AdditionalOptions>, ..._args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
80
80
|
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
81
81
|
promiseStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: AsArray<T>): Promise<R>;
|
|
82
82
|
promise(...args: AsArray<T>): Promise<R>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@rspack/lite-tapable","version":"1.1.
|
|
1
|
+
{"name":"@rspack/lite-tapable","version":"1.1.1","license":"MIT","types":"./dist/index.d.ts","type":"module"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"connect-next","author":"TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)","version":"4.0.
|
|
1
|
+
{"name":"connect-next","author":"TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)","version":"4.0.2","license":"MIT","types":"index.d.ts","type":"module"}
|
package/dist/612.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __webpack_modules__ = {}, __webpack_module_cache__ = {};
|
|
2
|
+
function __webpack_require__(moduleId) {
|
|
3
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
9
|
+
}
|
|
10
|
+
__webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return __webpack_require__.d(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, __webpack_require__.d = (exports, getters, values)=>{
|
|
16
|
+
var define = (defs, kind)=>{
|
|
17
|
+
for(var key in defs)__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
[kind]: defs[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get"), define(values, "value");
|
|
23
|
+
}, __webpack_require__.add = function(modules) {
|
|
24
|
+
Object.assign(__webpack_require__.m, modules);
|
|
25
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
26
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
27
|
+
value: 'Module'
|
|
28
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
29
|
+
value: !0
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { __webpack_require__ };
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base.js';
|
|
3
|
+
import type { Module } from '../Module.js';
|
|
4
|
+
export interface DeterministicModuleIdsPluginOptions {
|
|
5
|
+
context?: string;
|
|
6
|
+
test?: (module: Module) => boolean;
|
|
7
|
+
maxLength?: number;
|
|
8
|
+
salt?: number;
|
|
9
|
+
fixedLength?: boolean;
|
|
10
|
+
failOnConflict?: boolean;
|
|
11
|
+
}
|
|
3
12
|
export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
13
|
+
private options;
|
|
4
14
|
name: BuiltinPluginName;
|
|
5
15
|
affectedHooks: 'compilation';
|
|
16
|
+
constructor(options?: DeterministicModuleIdsPluginOptions);
|
|
6
17
|
raw(): BuiltinPlugin;
|
|
7
18
|
}
|
|
@@ -6,7 +6,8 @@ export declare class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
|
6
6
|
private type;
|
|
7
7
|
private externals;
|
|
8
8
|
private placeInInitial?;
|
|
9
|
+
private fallbackType?;
|
|
9
10
|
name: BuiltinPluginName;
|
|
10
|
-
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined);
|
|
11
|
+
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined, fallbackType?: string | undefined);
|
|
11
12
|
raw(): BuiltinPlugin | undefined;
|
|
12
13
|
}
|
package/dist/config/target.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export type EcmaTargetProperties = {
|
|
|
61
61
|
bigIntLiteral: boolean | null;
|
|
62
62
|
/** const and let variable declarations are available */
|
|
63
63
|
const: boolean | null;
|
|
64
|
+
/** computed property names in object literals are available */
|
|
65
|
+
computedProperty: boolean | null;
|
|
64
66
|
/** method shorthand in object is available */
|
|
65
67
|
methodShorthand: boolean | null;
|
|
66
68
|
/** arrow functions are available */
|
package/dist/config/types.d.ts
CHANGED
|
@@ -268,6 +268,8 @@ export type Environment = {
|
|
|
268
268
|
bigIntLiteral?: boolean;
|
|
269
269
|
/** The environment supports const and let for variable declarations. */
|
|
270
270
|
const?: boolean;
|
|
271
|
+
/** The environment supports computed property names in object literals ('{ [expr]: value }'). */
|
|
272
|
+
computedProperty?: boolean;
|
|
271
273
|
/** The environment supports destructuring ('{ a, b } = obj'). */
|
|
272
274
|
destructuring?: boolean;
|
|
273
275
|
/** The environment supports 'document' variable. */
|
|
@@ -752,11 +754,31 @@ export type CssParserOptions = {
|
|
|
752
754
|
* @default true
|
|
753
755
|
* */
|
|
754
756
|
url?: CssParserUrl;
|
|
757
|
+
/**
|
|
758
|
+
* Allow to enable/disables `@import` at-rules handling.
|
|
759
|
+
* @default true
|
|
760
|
+
* */
|
|
761
|
+
import?: boolean;
|
|
755
762
|
/**
|
|
756
763
|
* Allow to enable/disables `@import` at-rules handling.
|
|
757
764
|
* @default true
|
|
758
765
|
* */
|
|
759
766
|
resolveImport?: CssParserResolveImport;
|
|
767
|
+
/**
|
|
768
|
+
* Enable/disable renaming of `@keyframes`.
|
|
769
|
+
* @default true
|
|
770
|
+
*/
|
|
771
|
+
animation?: boolean;
|
|
772
|
+
/**
|
|
773
|
+
* Enable/disable renaming of custom identifiers.
|
|
774
|
+
* @default false
|
|
775
|
+
*/
|
|
776
|
+
customIdents?: boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
779
|
+
* @default false
|
|
780
|
+
*/
|
|
781
|
+
dashedIdents?: boolean;
|
|
760
782
|
};
|
|
761
783
|
/** Options object for `css/auto`, `css/global` and `css/module` modules. */
|
|
762
784
|
export type CssModuleParserOptions = {
|
|
@@ -774,7 +796,27 @@ export type CssModuleParserOptions = {
|
|
|
774
796
|
* Allow to enable/disables `@import` at-rules handling.
|
|
775
797
|
* @default true
|
|
776
798
|
* */
|
|
799
|
+
import?: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* Allow to filter handling of `@import` at-rules.
|
|
802
|
+
* @default true
|
|
803
|
+
* */
|
|
777
804
|
resolveImport?: CssParserResolveImport;
|
|
805
|
+
/**
|
|
806
|
+
* Enable/disable renaming of `@keyframes`.
|
|
807
|
+
* @default true
|
|
808
|
+
*/
|
|
809
|
+
animation?: boolean;
|
|
810
|
+
/**
|
|
811
|
+
* Enable/disable renaming of custom identifiers.
|
|
812
|
+
* @default false
|
|
813
|
+
*/
|
|
814
|
+
customIdents?: boolean;
|
|
815
|
+
/**
|
|
816
|
+
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
817
|
+
* @default false
|
|
818
|
+
*/
|
|
819
|
+
dashedIdents?: boolean;
|
|
778
820
|
};
|
|
779
821
|
type ExportsPresence = 'error' | 'warn' | 'auto' | false;
|
|
780
822
|
export type JavascriptParserCommonjsExports = boolean | 'skipInEsm';
|
package/dist/exports.d.ts
CHANGED
|
@@ -79,8 +79,9 @@ interface Electron {
|
|
|
79
79
|
ElectronTargetPlugin: typeof ElectronTargetPlugin;
|
|
80
80
|
}
|
|
81
81
|
export declare const electron: Electron;
|
|
82
|
-
import { HashedModuleIdsPlugin } from './builtin-plugin/index.js';
|
|
82
|
+
import { DeterministicModuleIdsPlugin, HashedModuleIdsPlugin } from './builtin-plugin/index.js';
|
|
83
83
|
interface Ids {
|
|
84
|
+
DeterministicModuleIdsPlugin: typeof DeterministicModuleIdsPlugin;
|
|
84
85
|
HashedModuleIdsPlugin: typeof HashedModuleIdsPlugin;
|
|
85
86
|
}
|
|
86
87
|
export declare const ids: Ids;
|
package/dist/index.js
CHANGED
|
@@ -4,36 +4,10 @@ import { createRequire, createRequire as __rspack_createRequire } from "node:mod
|
|
|
4
4
|
import node_path, { isAbsolute, join, relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
5
5
|
import node_querystring from "node:querystring";
|
|
6
6
|
import node_fs, { readFileSync } from "node:fs";
|
|
7
|
+
import { __webpack_require__ } from "./612.js";
|
|
7
8
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
8
9
|
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
9
|
-
|
|
10
|
-
function __webpack_require__(moduleId) {
|
|
11
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
13
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
14
|
-
exports: {}
|
|
15
|
-
};
|
|
16
|
-
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
17
|
-
}
|
|
18
|
-
__webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
19
|
-
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
20
|
-
return __webpack_require__.d(getter, {
|
|
21
|
-
a: getter
|
|
22
|
-
}), getter;
|
|
23
|
-
}, __webpack_require__.d = (exports, definition)=>{
|
|
24
|
-
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
25
|
-
enumerable: !0,
|
|
26
|
-
get: definition[key]
|
|
27
|
-
});
|
|
28
|
-
}, __webpack_require__.add = function(modules) {
|
|
29
|
-
Object.assign(__webpack_require__.m, modules);
|
|
30
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
31
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
32
|
-
value: 'Module'
|
|
33
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
34
|
-
value: !0
|
|
35
|
-
});
|
|
36
|
-
}, __webpack_require__.add({
|
|
10
|
+
__webpack_require__.add({
|
|
37
11
|
"../../node_modules/.pnpm/enhanced-resolve@5.21.3/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
38
12
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
39
13
|
let idx = path.length - 1;
|
|
@@ -243,7 +217,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
243
217
|
module.exports = __rspack_createRequire_require("process");
|
|
244
218
|
}
|
|
245
219
|
});
|
|
246
|
-
var browserslistTargetHandler_namespaceObject = {};
|
|
220
|
+
var RuntimeGlobals, key, StatsErrorCode, browserslistTargetHandler_namespaceObject = {};
|
|
247
221
|
__webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
|
|
248
222
|
resolve: ()=>browserslistTargetHandler_resolve
|
|
249
223
|
});
|
|
@@ -385,7 +359,7 @@ class HookBase {
|
|
|
385
359
|
queryStageRange(stageRange) {
|
|
386
360
|
return new QueriedHook(stageRange, this);
|
|
387
361
|
}
|
|
388
|
-
callAsyncStageRange(
|
|
362
|
+
callAsyncStageRange(_queried) {
|
|
389
363
|
throw Error('Hook should implement there own _callAsyncStageRange');
|
|
390
364
|
}
|
|
391
365
|
callAsync(...args) {
|
|
@@ -2439,21 +2413,21 @@ let HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
|
|
|
2439
2413
|
function canInherentFromParent(affectedHooks) {
|
|
2440
2414
|
return void 0 !== affectedHooks && !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
|
|
2441
2415
|
}
|
|
2442
|
-
class
|
|
2416
|
+
class RspackBuiltinPlugin {
|
|
2443
2417
|
affectedHooks;
|
|
2444
2418
|
apply(compiler) {
|
|
2445
2419
|
let raw = this.raw(compiler);
|
|
2446
2420
|
raw && (raw.canInherentFromParent = canInherentFromParent(this.affectedHooks), compiler.__internal__registerBuiltinPlugin(raw));
|
|
2447
2421
|
}
|
|
2448
2422
|
}
|
|
2449
|
-
function
|
|
2423
|
+
function createBuiltinPlugin(name, options) {
|
|
2450
2424
|
return {
|
|
2451
2425
|
name: name,
|
|
2452
2426
|
options: options ?? !1
|
|
2453
2427
|
};
|
|
2454
2428
|
}
|
|
2455
2429
|
function base_create(name, resolve, affectedHooks) {
|
|
2456
|
-
class Plugin extends
|
|
2430
|
+
class Plugin extends RspackBuiltinPlugin {
|
|
2457
2431
|
name = name;
|
|
2458
2432
|
_args;
|
|
2459
2433
|
affectedHooks = affectedHooks;
|
|
@@ -2461,7 +2435,7 @@ function base_create(name, resolve, affectedHooks) {
|
|
|
2461
2435
|
super(), this._args = args;
|
|
2462
2436
|
}
|
|
2463
2437
|
raw(compiler) {
|
|
2464
|
-
return
|
|
2438
|
+
return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
|
|
2465
2439
|
}
|
|
2466
2440
|
}
|
|
2467
2441
|
return Object.defineProperty(Plugin, 'name', {
|
|
@@ -2484,7 +2458,13 @@ let INTERNAL_PLUGIN_NAMES = Object.keys(binding_default().BuiltinPluginName), AP
|
|
|
2484
2458
|
bundler: options.bundler || 'rspack',
|
|
2485
2459
|
force: options.force ?? !1
|
|
2486
2460
|
})), CaseSensitivePlugin = base_create(binding_namespaceObject.BuiltinPluginName.CaseSensitivePlugin, ()=>{}, 'compilation'), ChunkPrefetchPreloadPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
|
|
2487
|
-
class
|
|
2461
|
+
class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
|
|
2462
|
+
name = binding_namespaceObject.BuiltinPluginName.CircularModulesInfoPlugin;
|
|
2463
|
+
raw(_compiler) {
|
|
2464
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
2488
2468
|
name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
|
|
2489
2469
|
_options;
|
|
2490
2470
|
constructor(options){
|
|
@@ -2512,7 +2492,7 @@ class CircularDependencyRspackPlugin extends base_RspackBuiltinPlugin {
|
|
|
2512
2492
|
this._options.onEnd(compilation);
|
|
2513
2493
|
} : void 0
|
|
2514
2494
|
};
|
|
2515
|
-
return
|
|
2495
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
2516
2496
|
}
|
|
2517
2497
|
}
|
|
2518
2498
|
let CommonJsChunkFormatPlugin = base_create(binding_namespaceObject.BuiltinPluginName.CommonJsChunkFormatPlugin, ()=>{}), ContextReplacementPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ContextReplacementPlugin, (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp)=>{
|
|
@@ -2595,18 +2575,24 @@ let DataUriPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DataUr
|
|
|
2595
2575
|
])) : normalizePrimitive(define);
|
|
2596
2576
|
return normalizeObject(define);
|
|
2597
2577
|
};
|
|
2598
|
-
class DeterministicChunkIdsPlugin extends
|
|
2578
|
+
class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
2599
2579
|
name = binding_namespaceObject.BuiltinPluginName.DeterministicChunkIdsPlugin;
|
|
2600
2580
|
affectedHooks = 'compilation';
|
|
2601
2581
|
raw() {
|
|
2602
|
-
return
|
|
2582
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
2603
2583
|
}
|
|
2604
2584
|
}
|
|
2605
|
-
class DeterministicModuleIdsPlugin extends
|
|
2585
|
+
class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
2586
|
+
options;
|
|
2606
2587
|
name = binding_namespaceObject.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
|
2607
2588
|
affectedHooks = 'compilation';
|
|
2589
|
+
constructor(options = {}){
|
|
2590
|
+
super(), this.options = options;
|
|
2591
|
+
}
|
|
2608
2592
|
raw() {
|
|
2609
|
-
return
|
|
2593
|
+
return createBuiltinPlugin(this.name, {
|
|
2594
|
+
...this.options
|
|
2595
|
+
});
|
|
2610
2596
|
}
|
|
2611
2597
|
}
|
|
2612
2598
|
let DllEntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
|
|
@@ -2662,7 +2648,7 @@ function getRawEntryOptions(entry) {
|
|
|
2662
2648
|
};
|
|
2663
2649
|
}
|
|
2664
2650
|
EntryPlugin.createDependency = (request)=>new binding_namespaceObject.EntryDependency(request);
|
|
2665
|
-
class DynamicEntryPlugin extends
|
|
2651
|
+
class DynamicEntryPlugin extends RspackBuiltinPlugin {
|
|
2666
2652
|
context;
|
|
2667
2653
|
entry;
|
|
2668
2654
|
name = binding_namespaceObject.BuiltinPluginName.DynamicEntryPlugin;
|
|
@@ -2681,7 +2667,7 @@ class DynamicEntryPlugin extends base_RspackBuiltinPlugin {
|
|
|
2681
2667
|
};
|
|
2682
2668
|
})
|
|
2683
2669
|
};
|
|
2684
|
-
return
|
|
2670
|
+
return createBuiltinPlugin(this.name, raw);
|
|
2685
2671
|
}
|
|
2686
2672
|
}
|
|
2687
2673
|
let ElectronTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ElectronTargetPlugin, (context)=>context ?? 'none'), EnableChunkLoadingPluginInner = base_create(binding_namespaceObject.BuiltinPluginName.EnableChunkLoadingPlugin, (type)=>type), enabledTypes = new WeakMap(), getEnabledTypes = (compiler)=>{
|
|
@@ -2717,7 +2703,7 @@ class JsSplitChunkSizes {
|
|
|
2717
2703
|
} : sizes;
|
|
2718
2704
|
}
|
|
2719
2705
|
}
|
|
2720
|
-
class SplitChunksPlugin extends
|
|
2706
|
+
class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
2721
2707
|
options;
|
|
2722
2708
|
name = binding_namespaceObject.BuiltinPluginName.SplitChunksPlugin;
|
|
2723
2709
|
affectedHooks = 'thisCompilation';
|
|
@@ -2727,7 +2713,7 @@ class SplitChunksPlugin extends base_RspackBuiltinPlugin {
|
|
|
2727
2713
|
raw(compiler) {
|
|
2728
2714
|
let rawOptions = SplitChunksPlugin_toRawSplitChunksOptions(this.options, compiler);
|
|
2729
2715
|
if (void 0 === rawOptions) throw Error('rawOptions should not be undefined');
|
|
2730
|
-
return
|
|
2716
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
2731
2717
|
}
|
|
2732
2718
|
}
|
|
2733
2719
|
function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
@@ -2785,7 +2771,7 @@ let EnableLibraryPlugin_enabledTypes = new WeakMap(), EnableLibraryPlugin_getEna
|
|
|
2785
2771
|
let set = EnableLibraryPlugin_enabledTypes.get(compiler);
|
|
2786
2772
|
return void 0 === set && (set = new Set(), EnableLibraryPlugin_enabledTypes.set(compiler, set)), set;
|
|
2787
2773
|
};
|
|
2788
|
-
class EnableLibraryPlugin extends
|
|
2774
|
+
class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
|
2789
2775
|
type;
|
|
2790
2776
|
name = binding_namespaceObject.BuiltinPluginName.EnableLibraryPlugin;
|
|
2791
2777
|
constructor(type){
|
|
@@ -2799,7 +2785,7 @@ class EnableLibraryPlugin extends base_RspackBuiltinPlugin {
|
|
|
2799
2785
|
}
|
|
2800
2786
|
raw(compiler) {
|
|
2801
2787
|
let type = this.type, enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
|
|
2802
|
-
if (!enabled.has(type)) return enabled.add(type),
|
|
2788
|
+
if (!enabled.has(type)) return enabled.add(type), createBuiltinPlugin(this.name, {
|
|
2803
2789
|
libraryType: type,
|
|
2804
2790
|
preserveModules: compiler.options.output.library?.preserveModules,
|
|
2805
2791
|
splitChunks: SplitChunksPlugin_toRawSplitChunksOptions(compiler.options.optimization.splitChunks ?? !1, compiler)
|
|
@@ -4403,7 +4389,7 @@ function getRawRuleSetCondition(condition) {
|
|
|
4403
4389
|
throw Error('unreachable: condition should be one of string, RegExp, Array, Object');
|
|
4404
4390
|
}
|
|
4405
4391
|
function getRawParserOptions(parser, type) {
|
|
4406
|
-
var parser1, parser2;
|
|
4392
|
+
var parser1, parser2, parser3;
|
|
4407
4393
|
if ('asset' === type) {
|
|
4408
4394
|
return {
|
|
4409
4395
|
type: 'asset',
|
|
@@ -4436,10 +4422,20 @@ function getRawParserOptions(parser, type) {
|
|
|
4436
4422
|
type: "javascript/esm",
|
|
4437
4423
|
javascript: getRawJavascriptParserOptions(parser)
|
|
4438
4424
|
};
|
|
4439
|
-
if ('css' === type)
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4425
|
+
if ('css' === type) {
|
|
4426
|
+
return {
|
|
4427
|
+
type: 'css',
|
|
4428
|
+
css: {
|
|
4429
|
+
namedExports: (parser2 = parser).namedExports,
|
|
4430
|
+
url: parser2.url,
|
|
4431
|
+
import: parser2.import,
|
|
4432
|
+
resolveImport: parser2.resolveImport,
|
|
4433
|
+
animation: parser2.animation,
|
|
4434
|
+
customIdents: parser2.customIdents,
|
|
4435
|
+
dashedIdents: parser2.dashedIdents
|
|
4436
|
+
}
|
|
4437
|
+
};
|
|
4438
|
+
}
|
|
4443
4439
|
if ('css/auto' === type) return {
|
|
4444
4440
|
type: 'css/auto',
|
|
4445
4441
|
cssAuto: getRawCssParserOptions(parser)
|
|
@@ -4456,8 +4452,8 @@ function getRawParserOptions(parser, type) {
|
|
|
4456
4452
|
return {
|
|
4457
4453
|
type: 'json',
|
|
4458
4454
|
json: {
|
|
4459
|
-
exportsDepth: (
|
|
4460
|
-
parse: 'function' == typeof
|
|
4455
|
+
exportsDepth: (parser3 = parser).exportsDepth,
|
|
4456
|
+
parse: 'function' == typeof parser3.parse ? (str)=>JSON.stringify(parser3.parse(str)) : void 0
|
|
4461
4457
|
}
|
|
4462
4458
|
};
|
|
4463
4459
|
}
|
|
@@ -4501,7 +4497,11 @@ function getRawCssParserOptions(parser) {
|
|
|
4501
4497
|
return {
|
|
4502
4498
|
namedExports: parser.namedExports,
|
|
4503
4499
|
url: parser.url,
|
|
4504
|
-
|
|
4500
|
+
import: parser.import,
|
|
4501
|
+
resolveImport: parser.resolveImport,
|
|
4502
|
+
animation: parser.animation,
|
|
4503
|
+
customIdents: parser.customIdents,
|
|
4504
|
+
dashedIdents: parser.dashedIdents
|
|
4505
4505
|
};
|
|
4506
4506
|
}
|
|
4507
4507
|
function getRawGeneratorOptions(generator, type) {
|
|
@@ -4594,24 +4594,26 @@ function getRawCssAutoOrModuleGeneratorOptions(options) {
|
|
|
4594
4594
|
esModule: options.esModule
|
|
4595
4595
|
};
|
|
4596
4596
|
}
|
|
4597
|
-
class ExternalsPlugin extends
|
|
4597
|
+
class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
4598
4598
|
type;
|
|
4599
4599
|
externals;
|
|
4600
4600
|
placeInInitial;
|
|
4601
|
+
fallbackType;
|
|
4601
4602
|
name = binding_namespaceObject.BuiltinPluginName.ExternalsPlugin;
|
|
4602
4603
|
#resolveRequestCache = new Map();
|
|
4603
|
-
constructor(type, externals, placeInInitial){
|
|
4604
|
-
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial;
|
|
4604
|
+
constructor(type, externals, placeInInitial, fallbackType){
|
|
4605
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial, this.fallbackType = fallbackType;
|
|
4605
4606
|
}
|
|
4606
4607
|
raw() {
|
|
4607
4608
|
let type = this.type, externals = this.externals, raw = {
|
|
4608
4609
|
type,
|
|
4610
|
+
fallbackType: this.fallbackType,
|
|
4609
4611
|
externals: (Array.isArray(externals) ? externals : [
|
|
4610
4612
|
externals
|
|
4611
4613
|
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
|
4612
4614
|
placeInInitial: this.placeInInitial ?? !1
|
|
4613
4615
|
};
|
|
4614
|
-
return
|
|
4616
|
+
return createBuiltinPlugin(this.name, raw);
|
|
4615
4617
|
}
|
|
4616
4618
|
#processResolveResult = (text)=>{
|
|
4617
4619
|
if (!text) return;
|
|
@@ -4689,7 +4691,7 @@ function getRawExternalItemValue(value) {
|
|
|
4689
4691
|
])) : value;
|
|
4690
4692
|
}
|
|
4691
4693
|
let FetchCompileAsyncWasmPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FetchCompileAsyncWasmPlugin, ()=>{}, 'thisCompilation'), FileUriPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FileUriPlugin, ()=>{}, 'compilation'), FlagDependencyExportsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, 'compilation');
|
|
4692
|
-
class FlagDependencyUsagePlugin extends
|
|
4694
|
+
class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
|
4693
4695
|
global;
|
|
4694
4696
|
name = binding_namespaceObject.BuiltinPluginName.FlagDependencyUsagePlugin;
|
|
4695
4697
|
affectedHooks = 'compilation';
|
|
@@ -4697,16 +4699,16 @@ class FlagDependencyUsagePlugin extends base_RspackBuiltinPlugin {
|
|
|
4697
4699
|
super(), this.global = global;
|
|
4698
4700
|
}
|
|
4699
4701
|
raw() {
|
|
4700
|
-
return
|
|
4702
|
+
return createBuiltinPlugin(this.name, this.global);
|
|
4701
4703
|
}
|
|
4702
4704
|
}
|
|
4703
4705
|
let HashedModuleIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HashedModuleIdsPlugin, (options)=>({
|
|
4704
4706
|
...options
|
|
4705
4707
|
}), 'compilation');
|
|
4706
|
-
class HotModuleReplacementPlugin extends
|
|
4708
|
+
class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
|
|
4707
4709
|
name = binding_namespaceObject.BuiltinPluginName.HotModuleReplacementPlugin;
|
|
4708
4710
|
raw(compiler) {
|
|
4709
|
-
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0),
|
|
4711
|
+
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
|
|
4710
4712
|
}
|
|
4711
4713
|
}
|
|
4712
4714
|
let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HttpExternalsRspackPlugin, (webAsync)=>({
|
|
@@ -4740,7 +4742,7 @@ let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPlugi
|
|
|
4740
4742
|
body: Buffer.from(body)
|
|
4741
4743
|
};
|
|
4742
4744
|
};
|
|
4743
|
-
class HttpUriPlugin extends
|
|
4745
|
+
class HttpUriPlugin extends RspackBuiltinPlugin {
|
|
4744
4746
|
options;
|
|
4745
4747
|
name = binding_namespaceObject.BuiltinPluginName.HttpUriPlugin;
|
|
4746
4748
|
affectedHooks = 'compilation';
|
|
@@ -4755,7 +4757,7 @@ class HttpUriPlugin extends base_RspackBuiltinPlugin {
|
|
|
4755
4757
|
upgrade: options.upgrade ?? !1,
|
|
4756
4758
|
httpClient: options.httpClient ?? defaultHttpClientForNode
|
|
4757
4759
|
};
|
|
4758
|
-
return
|
|
4760
|
+
return createBuiltinPlugin(this.name, raw);
|
|
4759
4761
|
}
|
|
4760
4762
|
}
|
|
4761
4763
|
let compilationOptionsMap = new WeakMap(), hooks_compilationHooksMap = new WeakMap(), plugin_require = createRequire(import.meta.url), HTML_PLUGIN_UID = 0, HtmlRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
|
@@ -4906,11 +4908,11 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML)=>({
|
|
|
4906
4908
|
}, hooks_compilationHooksMap.set(compilation, hooks)), hooks;
|
|
4907
4909
|
}, HtmlRspackPlugin.version = 5;
|
|
4908
4910
|
let IgnorePlugin = base_create(binding_namespaceObject.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_namespaceObject.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, 'compilation'), InlineExportsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.InlineExportsPlugin, ()=>{}, 'compilation'), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
|
|
4909
|
-
class JavascriptModulesPlugin extends
|
|
4911
|
+
class JavascriptModulesPlugin extends RspackBuiltinPlugin {
|
|
4910
4912
|
name = binding_namespaceObject.BuiltinPluginName.JavascriptModulesPlugin;
|
|
4911
4913
|
affectedHooks = 'compilation';
|
|
4912
4914
|
raw() {
|
|
4913
|
-
return
|
|
4915
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
4914
4916
|
}
|
|
4915
4917
|
static getCompilationHooks(compilation) {
|
|
4916
4918
|
checkCompilation(compilation);
|
|
@@ -5046,7 +5048,7 @@ let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilatio
|
|
|
5046
5048
|
moduleActivated.length && compiler.watching && compiler.watching.invalidate(), res.writeHead(200), res.write('\n'), res.end();
|
|
5047
5049
|
};
|
|
5048
5050
|
};
|
|
5049
|
-
class MangleExportsPlugin extends
|
|
5051
|
+
class MangleExportsPlugin extends RspackBuiltinPlugin {
|
|
5050
5052
|
deterministic;
|
|
5051
5053
|
name = binding_namespaceObject.BuiltinPluginName.MangleExportsPlugin;
|
|
5052
5054
|
affectedHooks = 'compilation';
|
|
@@ -5054,30 +5056,30 @@ class MangleExportsPlugin extends base_RspackBuiltinPlugin {
|
|
|
5054
5056
|
super(), this.deterministic = deterministic;
|
|
5055
5057
|
}
|
|
5056
5058
|
raw() {
|
|
5057
|
-
return
|
|
5059
|
+
return createBuiltinPlugin(this.name, this.deterministic);
|
|
5058
5060
|
}
|
|
5059
5061
|
}
|
|
5060
5062
|
let MergeDuplicateChunksPlugin = base_create(binding_namespaceObject.BuiltinPluginName.MergeDuplicateChunksPlugin, ()=>{}), ModuleChunkFormatPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleChunkFormatPlugin, ()=>{});
|
|
5061
|
-
class ModuleConcatenationPlugin extends
|
|
5063
|
+
class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
|
|
5062
5064
|
name = binding_namespaceObject.BuiltinPluginName.ModuleConcatenationPlugin;
|
|
5063
5065
|
affectedHooks = 'compilation';
|
|
5064
5066
|
raw() {
|
|
5065
|
-
return
|
|
5067
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
5066
5068
|
}
|
|
5067
5069
|
}
|
|
5068
5070
|
let ModuleInfoHeaderPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleInfoHeaderPlugin, (verbose)=>verbose, 'compilation'), NamedChunkIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NamedChunkIdsPlugin, ()=>{}, 'compilation'), NamedModuleIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NamedModuleIdsPlugin, ()=>{}, 'compilation');
|
|
5069
|
-
class NaturalChunkIdsPlugin extends
|
|
5071
|
+
class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
5070
5072
|
name = binding_namespaceObject.BuiltinPluginName.NaturalChunkIdsPlugin;
|
|
5071
5073
|
affectedHooks = 'compilation';
|
|
5072
5074
|
raw() {
|
|
5073
|
-
return
|
|
5075
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
5074
5076
|
}
|
|
5075
5077
|
}
|
|
5076
|
-
class NaturalModuleIdsPlugin extends
|
|
5078
|
+
class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
5077
5079
|
name = binding_namespaceObject.BuiltinPluginName.NaturalModuleIdsPlugin;
|
|
5078
5080
|
affectedHooks = 'compilation';
|
|
5079
5081
|
raw() {
|
|
5080
|
-
return
|
|
5082
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
5081
5083
|
}
|
|
5082
5084
|
}
|
|
5083
5085
|
let NodeTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), NormalModuleReplacementPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
|
|
@@ -5183,19 +5185,19 @@ class Coordinator {
|
|
|
5183
5185
|
});
|
|
5184
5186
|
}
|
|
5185
5187
|
}
|
|
5186
|
-
class RscClientPlugin extends
|
|
5188
|
+
class RscClientPlugin extends RspackBuiltinPlugin {
|
|
5187
5189
|
name = 'RscClientPlugin';
|
|
5188
5190
|
#options;
|
|
5189
5191
|
constructor(options){
|
|
5190
5192
|
super(), this.#options = options;
|
|
5191
5193
|
}
|
|
5192
5194
|
raw(compiler) {
|
|
5193
|
-
return this.#options.coordinator.applyClientCompiler(compiler),
|
|
5195
|
+
return this.#options.coordinator.applyClientCompiler(compiler), createBuiltinPlugin(this.name, {
|
|
5194
5196
|
coordinator: this.#options.coordinator[GET_OR_INIT_BINDING]()
|
|
5195
5197
|
});
|
|
5196
5198
|
}
|
|
5197
5199
|
}
|
|
5198
|
-
class RscServerPlugin extends
|
|
5200
|
+
class RscServerPlugin extends RspackBuiltinPlugin {
|
|
5199
5201
|
name = 'RscServerPlugin';
|
|
5200
5202
|
#options;
|
|
5201
5203
|
constructor(options){
|
|
@@ -5205,7 +5207,7 @@ class RscServerPlugin extends base_RspackBuiltinPlugin {
|
|
|
5205
5207
|
let onManifest;
|
|
5206
5208
|
this.#options.coordinator.applyServerCompiler(compiler);
|
|
5207
5209
|
let { coordinator, onServerComponentChanges } = this.#options;
|
|
5208
|
-
return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))),
|
|
5210
|
+
return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))), createBuiltinPlugin(this.name, {
|
|
5209
5211
|
coordinator: coordinator[GET_OR_INIT_BINDING](),
|
|
5210
5212
|
cssLink: this.#options.cssLink,
|
|
5211
5213
|
onServerComponentChanges,
|
|
@@ -5213,7 +5215,7 @@ class RscServerPlugin extends base_RspackBuiltinPlugin {
|
|
|
5213
5215
|
});
|
|
5214
5216
|
}
|
|
5215
5217
|
}
|
|
5216
|
-
class SideEffectsFlagPlugin extends
|
|
5218
|
+
class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
|
|
5217
5219
|
analyzeSideEffectsFree;
|
|
5218
5220
|
name = binding_namespaceObject.BuiltinPluginName.SideEffectsFlagPlugin;
|
|
5219
5221
|
affectedHooks = 'compilation';
|
|
@@ -5221,7 +5223,7 @@ class SideEffectsFlagPlugin extends base_RspackBuiltinPlugin {
|
|
|
5221
5223
|
super(), this.analyzeSideEffectsFree = analyzeSideEffectsFree;
|
|
5222
5224
|
}
|
|
5223
5225
|
raw() {
|
|
5224
|
-
return
|
|
5226
|
+
return createBuiltinPlugin(this.name, this.analyzeSideEffectsFree);
|
|
5225
5227
|
}
|
|
5226
5228
|
}
|
|
5227
5229
|
let SizeLimitsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
|
@@ -5413,7 +5415,7 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
|
|
|
5413
5415
|
}
|
|
5414
5416
|
};
|
|
5415
5417
|
}, 'compilation'), URLPlugin = base_create(binding_namespaceObject.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
5416
|
-
class WorkerPlugin extends
|
|
5418
|
+
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
5417
5419
|
chunkLoading;
|
|
5418
5420
|
wasmLoading;
|
|
5419
5421
|
module;
|
|
@@ -5424,7 +5426,7 @@ class WorkerPlugin extends base_RspackBuiltinPlugin {
|
|
|
5424
5426
|
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
|
|
5425
5427
|
}
|
|
5426
5428
|
raw(compiler) {
|
|
5427
|
-
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler),
|
|
5429
|
+
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
|
|
5428
5430
|
}
|
|
5429
5431
|
}
|
|
5430
5432
|
class ContextModuleFactory {
|
|
@@ -5801,7 +5803,21 @@ let configCache = {}, ES_VERSIONS_MAP = {
|
|
|
5801
5803
|
ios_saf: 'safari',
|
|
5802
5804
|
and_chr: 'chrome',
|
|
5803
5805
|
and_ff: 'firefox'
|
|
5804
|
-
}, renameBrowser = (name)=>aliases[name] || name,
|
|
5806
|
+
}, renameBrowser = (name)=>aliases[name] || name, resolveESVersion = (version, thresholds)=>{
|
|
5807
|
+
let index = thresholds.findIndex((threshold)=>version < threshold);
|
|
5808
|
+
return -1 === index ? 2024 : [
|
|
5809
|
+
2015,
|
|
5810
|
+
2016,
|
|
5811
|
+
2017,
|
|
5812
|
+
2018,
|
|
5813
|
+
2019,
|
|
5814
|
+
2020,
|
|
5815
|
+
2021,
|
|
5816
|
+
2022,
|
|
5817
|
+
2023,
|
|
5818
|
+
2024
|
|
5819
|
+
][index - 1] ?? 5;
|
|
5820
|
+
}, browserslistTargetHandler_resolve = (browsers)=>{
|
|
5805
5821
|
let rawChecker = (versions)=>browsers.every((v)=>{
|
|
5806
5822
|
let [name, parsedVersion] = v.split(' ');
|
|
5807
5823
|
if (!name) return !1;
|
|
@@ -5926,6 +5942,35 @@ let configCache = {}, ES_VERSIONS_MAP = {
|
|
|
5926
5942
|
9
|
|
5927
5943
|
]
|
|
5928
5944
|
}),
|
|
5945
|
+
computedProperty: rawChecker({
|
|
5946
|
+
chrome: 47,
|
|
5947
|
+
and_chr: 47,
|
|
5948
|
+
edge: 12,
|
|
5949
|
+
firefox: 34,
|
|
5950
|
+
and_ff: 34,
|
|
5951
|
+
opera: 34,
|
|
5952
|
+
op_mob: 34,
|
|
5953
|
+
safari: 8,
|
|
5954
|
+
ios_saf: 8,
|
|
5955
|
+
samsung: 5,
|
|
5956
|
+
android: 47,
|
|
5957
|
+
and_qq: [
|
|
5958
|
+
14,
|
|
5959
|
+
9
|
|
5960
|
+
],
|
|
5961
|
+
and_uc: [
|
|
5962
|
+
15,
|
|
5963
|
+
5
|
|
5964
|
+
],
|
|
5965
|
+
kaios: [
|
|
5966
|
+
2,
|
|
5967
|
+
5
|
|
5968
|
+
],
|
|
5969
|
+
node: [
|
|
5970
|
+
4,
|
|
5971
|
+
0
|
|
5972
|
+
]
|
|
5973
|
+
}),
|
|
5929
5974
|
arrowFunction: rawChecker({
|
|
5930
5975
|
chrome: 45,
|
|
5931
5976
|
and_chr: 45,
|
|
@@ -6298,7 +6343,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6298
6343
|
break;
|
|
6299
6344
|
}
|
|
6300
6345
|
let versions = ES_VERSIONS_MAP[browser];
|
|
6301
|
-
versions && (
|
|
6346
|
+
versions && (esVersion = Math.min(resolveESVersion(version, versions), esVersion));
|
|
6302
6347
|
}
|
|
6303
6348
|
return esVersion;
|
|
6304
6349
|
}(browsers)
|
|
@@ -6373,6 +6418,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6373
6418
|
importScriptsInWorker: !1,
|
|
6374
6419
|
globalThis: v(12),
|
|
6375
6420
|
const: v(6),
|
|
6421
|
+
computedProperty: v(4),
|
|
6376
6422
|
templateLiteral: v(4),
|
|
6377
6423
|
optionalChaining: v(14),
|
|
6378
6424
|
methodShorthand: v(4),
|
|
@@ -6418,6 +6464,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6418
6464
|
importScriptsInWorker: !0,
|
|
6419
6465
|
globalThis: v(5),
|
|
6420
6466
|
const: v(1, 1),
|
|
6467
|
+
computedProperty: v(1, 1),
|
|
6421
6468
|
templateLiteral: v(1, 1),
|
|
6422
6469
|
optionalChaining: v(8),
|
|
6423
6470
|
methodShorthand: v(1, 1),
|
|
@@ -6458,6 +6505,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6458
6505
|
require: !1,
|
|
6459
6506
|
globalThis: v(0, 43),
|
|
6460
6507
|
const: v(0, 15),
|
|
6508
|
+
computedProperty: v(0, 15),
|
|
6461
6509
|
templateLiteral: v(0, 13),
|
|
6462
6510
|
optionalChaining: v(0, 44),
|
|
6463
6511
|
methodShorthand: v(0, 15),
|
|
@@ -6481,6 +6529,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6481
6529
|
return 5 < v && v < 1000 && (v += 2009), {
|
|
6482
6530
|
esVersion: v > 2022 ? 2022 : v,
|
|
6483
6531
|
const: v >= 2015,
|
|
6532
|
+
computedProperty: v >= 2015,
|
|
6484
6533
|
templateLiteral: v >= 2015,
|
|
6485
6534
|
optionalChaining: v >= 2020,
|
|
6486
6535
|
methodShorthand: v >= 2015,
|
|
@@ -6505,12 +6554,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6505
6554
|
}
|
|
6506
6555
|
}
|
|
6507
6556
|
throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join('\n')}`);
|
|
6508
|
-
},
|
|
6509
|
-
let context;
|
|
6510
|
-
F(options, 'context', ()=>process.cwd()), F(options, 'target', ()=>hasBrowserslistConfig(options.context) ? 'browserslist' : 'web');
|
|
6511
|
-
let { mode, target } = options;
|
|
6512
|
-
if (isNil(target)) throw Error('target should not be nil after defaults');
|
|
6513
|
-
let targetProperties = !1 !== target && ('string' == typeof target ? getTargetProperties(target, options.context) : (context = options.context, ((targetProperties)=>{
|
|
6557
|
+
}, getTargetsProperties = (targets, context)=>((targetProperties)=>{
|
|
6514
6558
|
let keys = new Set();
|
|
6515
6559
|
for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
|
|
6516
6560
|
let result = {};
|
|
@@ -6544,7 +6588,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6544
6588
|
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
|
6545
6589
|
}
|
|
6546
6590
|
return result;
|
|
6547
|
-
})(
|
|
6591
|
+
})(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
|
|
6592
|
+
F(options, 'context', ()=>process.cwd()), F(options, 'target', ()=>hasBrowserslistConfig(options.context) ? 'browserslist' : 'web');
|
|
6593
|
+
let { mode, target } = options;
|
|
6594
|
+
if (isNil(target)) throw Error('target should not be nil after defaults');
|
|
6595
|
+
let targetProperties = !1 !== target && ('string' == typeof target ? getTargetProperties(target, options.context) : getTargetsProperties(target, options.context)), development = 'development' === mode, production = 'production' === mode || !mode;
|
|
6548
6596
|
if ('function' != typeof options.entry) for (let key of Object.keys(options.entry))F(options.entry[key], 'import', ()=>[
|
|
6549
6597
|
'./src'
|
|
6550
6598
|
]);
|
|
@@ -6600,6 +6648,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6600
6648
|
D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
|
|
6601
6649
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssModuleGeneratorOptionsDefaults = (generatorOptions, { hashFunction, hashSalt, localIdentName, targetProperties })=>{
|
|
6602
6650
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0), D(generatorOptions, 'exportsConvention', 'as-is'), D(generatorOptions, 'localIdentName', localIdentName), D(generatorOptions, 'localIdentHashSalt', hashSalt), D(generatorOptions, 'localIdentHashFunction', hashFunction), D(generatorOptions, 'localIdentHashDigest', 'base64url'), D(generatorOptions, 'localIdentHashDigestLength', 6);
|
|
6651
|
+
}, applyCssModuleParserOptionsDefaults = (parserOptions)=>{
|
|
6652
|
+
D(parserOptions, 'namedExports', !0), D(parserOptions, 'url', !0), D(parserOptions, 'import', !0);
|
|
6603
6653
|
}, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport, outputModule, hashFunction, hashSalt })=>{
|
|
6604
6654
|
assertNotNill(module.parser), assertNotNill(module.generator), F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), F(module.parser.asset, 'dataUrlCondition', ()=>({})), 'object' == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, 'maxSize', 8096), F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { deferImport, outputModule })=>{
|
|
6605
6655
|
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, 'strictThisContextOnImports', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'exportsPresence', 'error'), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !1), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
|
|
@@ -6608,7 +6658,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6608
6658
|
})(module.parser.javascript, {
|
|
6609
6659
|
deferImport,
|
|
6610
6660
|
outputModule
|
|
6611
|
-
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, 'namedExports', !0), D(module.parser.css, 'url', !0),
|
|
6661
|
+
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, 'namedExports', !0), D(module.parser.css, 'url', !0), D(module.parser.css, 'import', !0), D(module.parser.css, 'animation', !0), F(module.parser, 'css/auto', ()=>({})), assertNotNill(module.parser['css/auto']), applyCssModuleParserOptionsDefaults(module.parser['css/auto']), F(module.parser, 'css/global', ()=>({})), assertNotNill(module.parser['css/global']), applyCssModuleParserOptionsDefaults(module.parser['css/global']), F(module.parser, 'css/module', ()=>({})), assertNotNill(module.parser['css/module']), applyCssModuleParserOptionsDefaults(module.parser['css/module']), F(module.generator, 'css', ()=>({})), assertNotNill(module.generator.css), ((generatorOptions, { targetProperties })=>{
|
|
6612
6662
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6613
6663
|
})(module.generator.css, {
|
|
6614
6664
|
targetProperties
|
|
@@ -6778,6 +6828,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6778
6828
|
}), F(environment, 'const', ()=>{
|
|
6779
6829
|
let v;
|
|
6780
6830
|
return tp && ((v = tp.const) || void 0 === v);
|
|
6831
|
+
}), F(environment, 'computedProperty', ()=>{
|
|
6832
|
+
let v;
|
|
6833
|
+
return tp && ((v = tp.computedProperty) || void 0 === v);
|
|
6781
6834
|
}), F(environment, 'methodShorthand', ()=>{
|
|
6782
6835
|
let v;
|
|
6783
6836
|
return tp && ((v = tp.methodShorthand) || void 0 === v);
|
|
@@ -6896,7 +6949,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6896
6949
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6897
6950
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6898
6951
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6899
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.
|
|
6952
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.6"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
|
|
6900
6953
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6901
6954
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6902
6955
|
D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
|
|
@@ -8150,7 +8203,7 @@ class MultiStats {
|
|
|
8150
8203
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8151
8204
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8152
8205
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8153
|
-
}), childOptions.version && (obj.rspackVersion = "2.0.
|
|
8206
|
+
}), childOptions.version && (obj.rspackVersion = "2.0.6", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8154
8207
|
let mapError = (j, obj)=>({
|
|
8155
8208
|
...obj,
|
|
8156
8209
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -9424,7 +9477,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9424
9477
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9425
9478
|
},
|
|
9426
9479
|
version: (object)=>{
|
|
9427
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.
|
|
9480
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.6";
|
|
9428
9481
|
},
|
|
9429
9482
|
env: (object, _compilation, _context, { _env })=>{
|
|
9430
9483
|
object.env = _env;
|
|
@@ -10651,7 +10704,10 @@ class RspackOptionsApply {
|
|
|
10651
10704
|
if (!options.output.path) throw Error('options.output.path should have a value after `applyRspackOptionsDefaults`');
|
|
10652
10705
|
if (compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = node_fs, options.externals) {
|
|
10653
10706
|
if (!options.externalsType) throw Error('options.externalsType should have a value after `applyRspackOptionsDefaults`');
|
|
10654
|
-
new ExternalsPlugin(options.externalsType, options.externals, !1
|
|
10707
|
+
new ExternalsPlugin(options.externalsType, options.externals, !1, function(options) {
|
|
10708
|
+
let { context, target } = options;
|
|
10709
|
+
return (assertNotNill(context), null == target || !1 === target) ? 'commonjs' : ('string' == typeof target ? getTargetProperties(target, context) : getTargetsProperties(target, context)).nodeBuiltins ? 'node-commonjs' : 'commonjs';
|
|
10710
|
+
}(options)).apply(compiler);
|
|
10655
10711
|
}
|
|
10656
10712
|
if (options.externalsPresets.node && (new NodeTargetPlugin().apply(compiler), new CssHttpExternalsRspackPlugin().apply(compiler)), options.externalsPresets.electronMain && new ElectronTargetPlugin('main').apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin('preload').apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin('renderer').apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin('node-commonjs', 'nw.gui', !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync) && new HttpExternalsRspackPlugin(!!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin('verbose' === options.output.pathinfo).apply(compiler), 'string' == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
|
10657
10713
|
case 'array-push':
|
|
@@ -10686,7 +10742,7 @@ class RspackOptionsApply {
|
|
|
10686
10742
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
10687
10743
|
namespace: options.output.devtoolNamespace
|
|
10688
10744
|
}).apply(compiler);
|
|
10689
|
-
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10745
|
+
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), 'production' === options.mode && new CircularModulesInfoPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10690
10746
|
let enableLibSplitChunks = !1;
|
|
10691
10747
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
|
10692
10748
|
let hasModernModule = options.output.enabledLibraryTypes.includes('modern-module'), hasNonModernModule = options.output.enabledLibraryTypes.some((t)=>'modern-module' !== t);
|
|
@@ -11082,7 +11138,7 @@ class TraceHookPlugin {
|
|
|
11082
11138
|
});
|
|
11083
11139
|
}
|
|
11084
11140
|
}
|
|
11085
|
-
let CORE_VERSION = "2.0.
|
|
11141
|
+
let CORE_VERSION = "2.0.6", VFILES_BY_COMPILER = new WeakMap();
|
|
11086
11142
|
class VirtualModulesPlugin {
|
|
11087
11143
|
#staticModules;
|
|
11088
11144
|
#compiler;
|
|
@@ -11304,6 +11360,7 @@ class Compiler {
|
|
|
11304
11360
|
#platform;
|
|
11305
11361
|
#target;
|
|
11306
11362
|
options;
|
|
11363
|
+
#rawOptions;
|
|
11307
11364
|
unsafeFastDrop = !1;
|
|
11308
11365
|
__internal_browser_require;
|
|
11309
11366
|
constructor(context, options){
|
|
@@ -11578,7 +11635,7 @@ class Compiler {
|
|
|
11578
11635
|
});
|
|
11579
11636
|
}
|
|
11580
11637
|
close(callback) {
|
|
11581
|
-
|
|
11638
|
+
this.watching ? this.watching.close(()=>{
|
|
11582
11639
|
this.close(callback);
|
|
11583
11640
|
}) : this.hooks.shutdown.callAsync((err)=>{
|
|
11584
11641
|
if (err) return callback(err);
|
|
@@ -11602,7 +11659,7 @@ class Compiler {
|
|
|
11602
11659
|
}
|
|
11603
11660
|
__internal__create_compilation(native) {
|
|
11604
11661
|
let compilation = this.#bindingCompilationMap.get(native);
|
|
11605
|
-
return compilation
|
|
11662
|
+
return compilation || ((compilation = new Compilation(this, native)).name = this.name, this.#bindingCompilationMap.set(native, compilation)), this.#compilation = compilation, compilation;
|
|
11606
11663
|
}
|
|
11607
11664
|
__internal__get_virtual_file_store() {
|
|
11608
11665
|
return this.#instance?.getVirtualFileStore();
|
|
@@ -11638,7 +11695,8 @@ Help:
|
|
|
11638
11695
|
`));
|
|
11639
11696
|
if (error) return callback(error);
|
|
11640
11697
|
if (this.#instance) return callback(null, this.#instance);
|
|
11641
|
-
let { options } = this
|
|
11698
|
+
let { options } = this;
|
|
11699
|
+
this.#rawOptions = (mode = options.mode, experiments = options.experiments, {
|
|
11642
11700
|
name: options.name,
|
|
11643
11701
|
mode,
|
|
11644
11702
|
context: options.context,
|
|
@@ -11647,6 +11705,7 @@ Help:
|
|
|
11647
11705
|
environment: function(environment = {}) {
|
|
11648
11706
|
return {
|
|
11649
11707
|
const: !!environment.const,
|
|
11708
|
+
computedProperty: !!environment.computedProperty,
|
|
11650
11709
|
methodShorthand: !!environment.methodShorthand,
|
|
11651
11710
|
arrowFunction: !!environment.arrowFunction,
|
|
11652
11711
|
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
|
@@ -11722,13 +11781,12 @@ Help:
|
|
|
11722
11781
|
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
|
11723
11782
|
bail: options.bail,
|
|
11724
11783
|
__references: {}
|
|
11725
|
-
});
|
|
11726
|
-
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
11784
|
+
}), this.#rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), this.#rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
11727
11785
|
let instanceBinding = Compiler_require(process.env.RSPACK_BINDING ? process.env.RSPACK_BINDING : '@rspack/binding');
|
|
11728
11786
|
this.#registers = this.#createHooksRegisters();
|
|
11729
11787
|
let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
|
11730
11788
|
try {
|
|
11731
|
-
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop, this.#platform), callback(null, this.#instance);
|
|
11789
|
+
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, this.#rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop, this.#platform), callback(null, this.#instance);
|
|
11732
11790
|
} catch (err) {
|
|
11733
11791
|
err instanceof Error && delete err.stack, callback(Error('Failed to create Rspack compiler instance, check the Rspack configuration.', {
|
|
11734
11792
|
cause: err
|
|
@@ -12559,14 +12617,14 @@ let parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
|
|
12559
12617
|
else throw Error('Unexpected options format');
|
|
12560
12618
|
return items;
|
|
12561
12619
|
}, compilerSet = new WeakSet();
|
|
12562
|
-
class ShareRuntimePlugin extends
|
|
12620
|
+
class ShareRuntimePlugin extends RspackBuiltinPlugin {
|
|
12563
12621
|
enhanced;
|
|
12564
12622
|
name = binding_namespaceObject.BuiltinPluginName.ShareRuntimePlugin;
|
|
12565
12623
|
constructor(enhanced = !1){
|
|
12566
12624
|
super(), this.enhanced = enhanced;
|
|
12567
12625
|
}
|
|
12568
12626
|
raw(compiler) {
|
|
12569
|
-
if (!compilerSet.has(compiler)) return compilerSet.add(compiler),
|
|
12627
|
+
if (!compilerSet.has(compiler)) return compilerSet.add(compiler), createBuiltinPlugin(this.name, this.enhanced);
|
|
12570
12628
|
}
|
|
12571
12629
|
}
|
|
12572
12630
|
let VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
|
|
@@ -12612,7 +12670,7 @@ function normalizeConsumeShareOptions(consumes, shareScope) {
|
|
|
12612
12670
|
treeShakingMode: item.treeShakingMode
|
|
12613
12671
|
}));
|
|
12614
12672
|
}
|
|
12615
|
-
class ConsumeSharedPlugin extends
|
|
12673
|
+
class ConsumeSharedPlugin extends RspackBuiltinPlugin {
|
|
12616
12674
|
name = binding_namespaceObject.BuiltinPluginName.ConsumeSharedPlugin;
|
|
12617
12675
|
_options;
|
|
12618
12676
|
constructor(options){
|
|
@@ -12630,10 +12688,10 @@ class ConsumeSharedPlugin extends base_RspackBuiltinPlugin {
|
|
|
12630
12688
|
})),
|
|
12631
12689
|
enhanced: this._options.enhanced
|
|
12632
12690
|
};
|
|
12633
|
-
return
|
|
12691
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
12634
12692
|
}
|
|
12635
12693
|
}
|
|
12636
|
-
class ProvideSharedPlugin extends
|
|
12694
|
+
class ProvideSharedPlugin extends RspackBuiltinPlugin {
|
|
12637
12695
|
name = binding_namespaceObject.BuiltinPluginName.ProvideSharedPlugin;
|
|
12638
12696
|
_provides;
|
|
12639
12697
|
_enhanced;
|
|
@@ -12669,7 +12727,7 @@ class ProvideSharedPlugin extends base_RspackBuiltinPlugin {
|
|
|
12669
12727
|
key,
|
|
12670
12728
|
...v
|
|
12671
12729
|
}));
|
|
12672
|
-
return
|
|
12730
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
12673
12731
|
}
|
|
12674
12732
|
}
|
|
12675
12733
|
function validateShareScope(shareScope, enhanced, pluginName) {
|
|
@@ -12753,7 +12811,7 @@ function getFileName(manifestOptions) {
|
|
|
12753
12811
|
manifestFileName: join(filePath, manifestFileName)
|
|
12754
12812
|
};
|
|
12755
12813
|
}
|
|
12756
|
-
class ModuleFederationManifestPlugin extends
|
|
12814
|
+
class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
|
|
12757
12815
|
name = binding_namespaceObject.BuiltinPluginName.ModuleFederationManifestPlugin;
|
|
12758
12816
|
rawOpts;
|
|
12759
12817
|
constructor(opts){
|
|
@@ -12855,11 +12913,11 @@ class ModuleFederationManifestPlugin extends base_RspackBuiltinPlugin {
|
|
|
12855
12913
|
buildName: process.env.MF_BUILD_NAME || pkg?.name || 'UNKNOWN'
|
|
12856
12914
|
}, Object.values(normalizeSharedOptions(mfConfig1.shared || {})).some((config)=>config[1].treeShaking) && (statsBuildInfo.target = Array.isArray(compiler.options.target) ? compiler.options.target : [], statsBuildInfo.plugins = mfConfig1.treeShakingSharedPlugins || [], statsBuildInfo.excludePlugins = mfConfig1.treeShakingSharedExcludePlugins || []), statsBuildInfo)
|
|
12857
12915
|
};
|
|
12858
|
-
return
|
|
12916
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
12859
12917
|
}
|
|
12860
12918
|
}
|
|
12861
12919
|
let SHARE_ENTRY_ASSET = 'collect-shared-entries.json';
|
|
12862
|
-
class CollectSharedEntryPlugin extends
|
|
12920
|
+
class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
|
|
12863
12921
|
name = binding_namespaceObject.BuiltinPluginName.CollectSharedEntryPlugin;
|
|
12864
12922
|
sharedOptions;
|
|
12865
12923
|
_collectedEntries;
|
|
@@ -12894,13 +12952,13 @@ class CollectSharedEntryPlugin extends base_RspackBuiltinPlugin {
|
|
|
12894
12952
|
})),
|
|
12895
12953
|
filename: this.getFilename()
|
|
12896
12954
|
};
|
|
12897
|
-
return
|
|
12955
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
12898
12956
|
}
|
|
12899
12957
|
}
|
|
12900
12958
|
function assert(condition, msg) {
|
|
12901
12959
|
if (!condition) throw Error(msg);
|
|
12902
12960
|
}
|
|
12903
|
-
class SharedContainerPlugin extends
|
|
12961
|
+
class SharedContainerPlugin extends RspackBuiltinPlugin {
|
|
12904
12962
|
name = binding_namespaceObject.BuiltinPluginName.SharedContainerPlugin;
|
|
12905
12963
|
filename = '';
|
|
12906
12964
|
_options;
|
|
@@ -12934,7 +12992,7 @@ class SharedContainerPlugin extends base_RspackBuiltinPlugin {
|
|
|
12934
12992
|
}
|
|
12935
12993
|
raw(compiler) {
|
|
12936
12994
|
let { library } = this._options;
|
|
12937
|
-
return compiler.options.output.enabledLibraryTypes.includes(library.type) || compiler.options.output.enabledLibraryTypes.push(library.type),
|
|
12995
|
+
return compiler.options.output.enabledLibraryTypes.includes(library.type) || compiler.options.output.enabledLibraryTypes.push(library.type), createBuiltinPlugin(this.name, this._options);
|
|
12938
12996
|
}
|
|
12939
12997
|
apply(compiler) {
|
|
12940
12998
|
super.apply(compiler);
|
|
@@ -12952,7 +13010,7 @@ class SharedContainerPlugin extends base_RspackBuiltinPlugin {
|
|
|
12952
13010
|
});
|
|
12953
13011
|
}
|
|
12954
13012
|
}
|
|
12955
|
-
class SharedUsedExportsOptimizerPlugin extends
|
|
13013
|
+
class SharedUsedExportsOptimizerPlugin extends RspackBuiltinPlugin {
|
|
12956
13014
|
name = binding_namespaceObject.BuiltinPluginName.SharedUsedExportsOptimizerPlugin;
|
|
12957
13015
|
sharedOptions;
|
|
12958
13016
|
injectTreeShakingUsedExports;
|
|
@@ -12974,7 +13032,7 @@ class SharedUsedExportsOptimizerPlugin extends base_RspackBuiltinPlugin {
|
|
|
12974
13032
|
};
|
|
12975
13033
|
}
|
|
12976
13034
|
raw() {
|
|
12977
|
-
if (this.sharedOptions.length) return
|
|
13035
|
+
if (this.sharedOptions.length) return createBuiltinPlugin(this.name, this.buildOptions());
|
|
12978
13036
|
}
|
|
12979
13037
|
}
|
|
12980
13038
|
let VIRTUAL_ENTRY = './virtual-entry.js', VIRTUAL_ENTRY_NAME = 'virtual-entry';
|
|
@@ -13283,7 +13341,7 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
|
|
|
13283
13341
|
].join(';');
|
|
13284
13342
|
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${encodeURIComponent(content)}`;
|
|
13285
13343
|
}
|
|
13286
|
-
class ContainerPlugin extends
|
|
13344
|
+
class ContainerPlugin extends RspackBuiltinPlugin {
|
|
13287
13345
|
name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
|
|
13288
13346
|
_options;
|
|
13289
13347
|
constructor(options){
|
|
@@ -13327,10 +13385,10 @@ class ContainerPlugin extends base_RspackBuiltinPlugin {
|
|
|
13327
13385
|
})),
|
|
13328
13386
|
enhanced
|
|
13329
13387
|
};
|
|
13330
|
-
return
|
|
13388
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
13331
13389
|
}
|
|
13332
13390
|
}
|
|
13333
|
-
class ContainerReferencePlugin extends
|
|
13391
|
+
class ContainerReferencePlugin extends RspackBuiltinPlugin {
|
|
13334
13392
|
name = binding_namespaceObject.BuiltinPluginName.ContainerReferencePlugin;
|
|
13335
13393
|
_options;
|
|
13336
13394
|
constructor(options){
|
|
@@ -13374,7 +13432,7 @@ class ContainerReferencePlugin extends base_RspackBuiltinPlugin {
|
|
|
13374
13432
|
})),
|
|
13375
13433
|
enhanced: this._options.enhanced
|
|
13376
13434
|
};
|
|
13377
|
-
return
|
|
13435
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
13378
13436
|
}
|
|
13379
13437
|
}
|
|
13380
13438
|
async function minify(source, options) {
|
|
@@ -13385,7 +13443,7 @@ async function transform(source, options) {
|
|
|
13385
13443
|
let _options = JSON.stringify(options || {});
|
|
13386
13444
|
return binding_default().transform(source, _options);
|
|
13387
13445
|
}
|
|
13388
|
-
let exports_rspackVersion = "2.0.
|
|
13446
|
+
let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13389
13447
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13390
13448
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13391
13449
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -13416,6 +13474,7 @@ let exports_rspackVersion = "2.0.4", exports_version = "5.75.0", exports_Webpack
|
|
|
13416
13474
|
}, electron = {
|
|
13417
13475
|
ElectronTargetPlugin: ElectronTargetPlugin
|
|
13418
13476
|
}, exports_ids = {
|
|
13477
|
+
DeterministicModuleIdsPlugin: DeterministicModuleIdsPlugin,
|
|
13419
13478
|
HashedModuleIdsPlugin: HashedModuleIdsPlugin
|
|
13420
13479
|
}, exports_library = {
|
|
13421
13480
|
EnableLibraryPlugin: EnableLibraryPlugin
|
package/dist/worker.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
let createMd4, createXxhash64, url;
|
|
2
|
+
import { __webpack_require__ } from "./612.js";
|
|
2
3
|
import node_fs from "node:fs";
|
|
3
4
|
import node_querystring from "node:querystring";
|
|
4
5
|
import { inspect, promisify } from "node:util";
|
|
@@ -6,24 +7,6 @@ import { receiveMessageOnPort } from "node:worker_threads";
|
|
|
6
7
|
import { createRequire, createRequire as __rspack_createRequire } from "node:module";
|
|
7
8
|
import node_path from "node:path";
|
|
8
9
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
9
|
-
var __webpack_require__ = {};
|
|
10
|
-
__webpack_require__.n = (module)=>{
|
|
11
|
-
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
-
return __webpack_require__.d(getter, {
|
|
13
|
-
a: getter
|
|
14
|
-
}), getter;
|
|
15
|
-
}, __webpack_require__.d = (exports, definition)=>{
|
|
16
|
-
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: definition[key]
|
|
19
|
-
});
|
|
20
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
21
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
22
|
-
value: 'Module'
|
|
23
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
24
|
-
value: !0
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
10
|
var swc_namespaceObject = {};
|
|
28
11
|
__webpack_require__.r(swc_namespaceObject), __webpack_require__.d(swc_namespaceObject, {
|
|
29
12
|
minify: ()=>minify,
|
package/module.d.ts
CHANGED
|
@@ -171,6 +171,16 @@ declare namespace Rspack {
|
|
|
171
171
|
(dependency: string): unknown;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
type ImportMetaGlobPattern = string | readonly string[];
|
|
175
|
+
type ImportMetaGlobQuery = string | Record<string, string | number | boolean>;
|
|
176
|
+
type ImportMetaGlobOptions<Eager extends boolean = boolean> = {
|
|
177
|
+
eager?: Eager;
|
|
178
|
+
import?: string;
|
|
179
|
+
query?: ImportMetaGlobQuery;
|
|
180
|
+
exhaustive?: boolean;
|
|
181
|
+
base?: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
174
184
|
interface Module {
|
|
175
185
|
exports: any;
|
|
176
186
|
id: ModuleId;
|
|
@@ -241,6 +251,16 @@ interface ImportMeta {
|
|
|
241
251
|
rspackRsc?: {
|
|
242
252
|
loadCss(): any;
|
|
243
253
|
};
|
|
254
|
+
glob: {
|
|
255
|
+
<T = unknown>(
|
|
256
|
+
pattern: Rspack.ImportMetaGlobPattern,
|
|
257
|
+
options?: Rspack.ImportMetaGlobOptions<false>,
|
|
258
|
+
): Record<string, () => Promise<T>>;
|
|
259
|
+
<T = unknown>(
|
|
260
|
+
pattern: Rspack.ImportMetaGlobPattern,
|
|
261
|
+
options: Rspack.ImportMetaGlobOptions<true>,
|
|
262
|
+
): Record<string, T>;
|
|
263
|
+
};
|
|
244
264
|
}
|
|
245
265
|
|
|
246
266
|
declare const __resourceQuery: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-debug/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Fast Rust-based bundler for the web with a modernized webpack API",
|
|
@@ -37,32 +37,32 @@
|
|
|
37
37
|
"directory": "packages/rspack"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ast-grep/napi": "^0.
|
|
40
|
+
"@ast-grep/napi": "^0.43.0",
|
|
41
41
|
"@napi-rs/wasm-runtime": "1.1.4",
|
|
42
|
-
"@rsbuild/plugin-node-polyfill": "^1.4.
|
|
43
|
-
"@rslib/core": "^0.
|
|
44
|
-
"@rspack/lite-tapable": "1.1.
|
|
42
|
+
"@rsbuild/plugin-node-polyfill": "^1.4.5",
|
|
43
|
+
"@rslib/core": "^0.22.0",
|
|
44
|
+
"@rspack/lite-tapable": "1.1.1",
|
|
45
45
|
"@swc/types": "0.1.26",
|
|
46
46
|
"@types/node": "^20.19.41",
|
|
47
|
-
"browserslist-load-config": "^1.0.
|
|
48
|
-
"browserslist-to-es-version": "^1.4.
|
|
49
|
-
"connect-next": "^4.0.
|
|
47
|
+
"browserslist-load-config": "^1.0.2",
|
|
48
|
+
"browserslist-to-es-version": "^1.4.2",
|
|
49
|
+
"connect-next": "^4.0.2",
|
|
50
50
|
"enhanced-resolve": "5.21.3",
|
|
51
51
|
"http-proxy-middleware": "^4.0.0",
|
|
52
|
-
"memfs": "4.57.
|
|
52
|
+
"memfs": "4.57.3",
|
|
53
53
|
"open": "^11.0.0",
|
|
54
|
-
"prebundle": "^1.6.
|
|
54
|
+
"prebundle": "^1.6.5",
|
|
55
55
|
"tinypool": "^2.1.0",
|
|
56
56
|
"typescript": "^6.0.3",
|
|
57
57
|
"watchpack": "2.5.1",
|
|
58
58
|
"webpack-sources": "3.3.4"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@rspack/binding": "npm:@rspack-debug/binding@2.0.
|
|
61
|
+
"@rspack/binding": "npm:@rspack-debug/binding@2.0.6"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",
|
|
65
|
-
"@swc/helpers": "
|
|
65
|
+
"@swc/helpers": "^0.5.23"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@module-federation/runtime-tools": {
|