@rspack/core 1.1.2 → 1.1.3
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/Compilation.d.ts +11 -2
- package/dist/Dependency.d.ts +2 -0
- package/dist/Module.d.ts +1 -0
- package/dist/ModuleGraph.d.ts +10 -0
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -4
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -16
- package/dist/index.js +85 -52
- package/package.json +2 -2
package/dist/Compilation.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ import { ChunkGraph } from "./ChunkGraph";
|
|
|
16
16
|
import { ChunkGroup } from "./ChunkGroup";
|
|
17
17
|
import type { Compiler } from "./Compiler";
|
|
18
18
|
import type { ContextModuleFactory } from "./ContextModuleFactory";
|
|
19
|
+
import { Dependency } from "./Dependency";
|
|
19
20
|
import { Entrypoint } from "./Entrypoint";
|
|
20
21
|
import { type CodeGenerationResult, Module } from "./Module";
|
|
22
|
+
import ModuleGraph from "./ModuleGraph";
|
|
21
23
|
import type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
22
24
|
import type { ResolverFactory } from "./ResolverFactory";
|
|
23
25
|
import { type RspackError } from "./RspackError";
|
|
@@ -196,6 +198,7 @@ export declare class Compilation {
|
|
|
196
198
|
childrenCounters: Record<string, number>;
|
|
197
199
|
children: Compilation[];
|
|
198
200
|
chunkGraph: ChunkGraph;
|
|
201
|
+
moduleGraph: ModuleGraph;
|
|
199
202
|
fileSystemInfo: {
|
|
200
203
|
createSnapshot(): null;
|
|
201
204
|
};
|
|
@@ -391,12 +394,18 @@ export declare class Compilation {
|
|
|
391
394
|
static PROCESS_ASSETS_STAGE_ANALYSE: number;
|
|
392
395
|
static PROCESS_ASSETS_STAGE_REPORT: number;
|
|
393
396
|
}
|
|
394
|
-
export
|
|
397
|
+
export declare class EntryData {
|
|
398
|
+
dependencies: Dependency[];
|
|
399
|
+
includeDependencies: Dependency[];
|
|
400
|
+
options: binding.JsEntryOptions;
|
|
401
|
+
static __from_binding(binding: binding.JsEntryData): EntryData;
|
|
402
|
+
private constructor();
|
|
403
|
+
}
|
|
395
404
|
export declare class Entries implements Map<string, EntryData> {
|
|
396
405
|
#private;
|
|
397
406
|
constructor(data: binding.JsEntries);
|
|
398
407
|
clear(): void;
|
|
399
|
-
forEach(callback: (value:
|
|
408
|
+
forEach(callback: (value: EntryData, key: string, map: Map<string, EntryData>) => void, thisArg?: any): void;
|
|
400
409
|
get size(): number;
|
|
401
410
|
entries(): ReturnType<Map<string, EntryData>["entries"]>;
|
|
402
411
|
values(): ReturnType<Map<string, EntryData>["values"]>;
|
package/dist/Dependency.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { JsDependency } from "@rspack/binding";
|
|
2
2
|
export declare class Dependency {
|
|
3
|
+
#private;
|
|
3
4
|
readonly type: string;
|
|
4
5
|
readonly category: string;
|
|
5
6
|
readonly request: string | undefined;
|
|
6
7
|
critical: boolean;
|
|
7
8
|
static __from_binding(binding: JsDependency): Dependency;
|
|
9
|
+
static __to_binding(data: Dependency): JsDependency;
|
|
8
10
|
private constructor();
|
|
9
11
|
}
|
package/dist/Module.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare class Module {
|
|
|
76
76
|
readonly blocks: DependenciesBlock[];
|
|
77
77
|
readonly useSourceMap: boolean;
|
|
78
78
|
static __from_binding(binding: JsModule, compilation?: Compilation): Module;
|
|
79
|
+
static __to_binding(module: Module): JsModule;
|
|
79
80
|
constructor(module: JsModule, compilation?: Compilation);
|
|
80
81
|
originalSource(): Source | null;
|
|
81
82
|
identifier(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsModuleGraph } from "@rspack/binding";
|
|
2
|
+
import { Dependency } from "./Dependency";
|
|
3
|
+
import { Module } from "./Module";
|
|
4
|
+
export default class ModuleGraph {
|
|
5
|
+
#private;
|
|
6
|
+
static __from_binding(binding: JsModuleGraph): ModuleGraph;
|
|
7
|
+
private constructor();
|
|
8
|
+
getModule(dependency: Dependency): Module | null;
|
|
9
|
+
getIssuer(module: Module): Module | null;
|
|
10
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
import type { SourceMapDevToolPluginOptions } from "./SourceMapDevToolPlugin";
|
|
1
|
+
import { BuiltinPluginName, type RawSourceMapDevToolPluginOptions } from "@rspack/binding";
|
|
3
2
|
export declare const EvalSourceMapDevToolPlugin: {
|
|
4
|
-
new (options:
|
|
3
|
+
new (options: RawSourceMapDevToolPluginOptions): {
|
|
5
4
|
name: BuiltinPluginName;
|
|
6
|
-
_args: [options:
|
|
5
|
+
_args: [options: RawSourceMapDevToolPluginOptions];
|
|
7
6
|
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
8
7
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
8
|
apply(compiler: import("..").Compiler): void;
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
import { BuiltinPluginName, type RawSourceMapDevToolPluginOptions } from "@rspack/binding";
|
|
2
|
-
|
|
3
|
-
* Include source maps for modules based on their extension (defaults to .js and .css).
|
|
4
|
-
*/
|
|
5
|
-
type Rules = Rule[] | Rule;
|
|
6
|
-
/**
|
|
7
|
-
* Include source maps for modules based on their extension (defaults to .js and .css).
|
|
8
|
-
*/
|
|
9
|
-
type Rule = RegExp | string;
|
|
10
|
-
export interface SourceMapDevToolPluginOptions extends Omit<RawSourceMapDevToolPluginOptions, "test" | "include" | "exclude"> {
|
|
11
|
-
exclude?: Rules;
|
|
12
|
-
include?: Rules;
|
|
13
|
-
test?: Rules;
|
|
14
|
-
}
|
|
2
|
+
export type { RawSourceMapDevToolPluginOptions as SourceMapDevToolPluginOptions };
|
|
15
3
|
export declare const SourceMapDevToolPlugin: {
|
|
16
|
-
new (options:
|
|
4
|
+
new (options: RawSourceMapDevToolPluginOptions): {
|
|
17
5
|
name: BuiltinPluginName;
|
|
18
|
-
_args: [options:
|
|
6
|
+
_args: [options: RawSourceMapDevToolPluginOptions];
|
|
19
7
|
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
20
8
|
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
21
9
|
apply(compiler: import("..").Compiler): void;
|
|
22
10
|
};
|
|
23
11
|
};
|
|
24
|
-
export {};
|
package/dist/index.js
CHANGED
|
@@ -1091,10 +1091,15 @@ var import_binding3 = require("@rspack/binding");
|
|
|
1091
1091
|
|
|
1092
1092
|
// src/Dependency.ts
|
|
1093
1093
|
var Dependency = class _Dependency {
|
|
1094
|
+
#inner;
|
|
1094
1095
|
static __from_binding(binding3) {
|
|
1095
1096
|
return new _Dependency(binding3);
|
|
1096
1097
|
}
|
|
1098
|
+
static __to_binding(data) {
|
|
1099
|
+
return data.#inner;
|
|
1100
|
+
}
|
|
1097
1101
|
constructor(binding3) {
|
|
1102
|
+
this.#inner = binding3;
|
|
1098
1103
|
Object.defineProperties(this, {
|
|
1099
1104
|
type: {
|
|
1100
1105
|
enumerable: true,
|
|
@@ -1328,6 +1333,9 @@ var Module = class _Module {
|
|
|
1328
1333
|
MODULE_MAPPINGS.set(binding3, module2);
|
|
1329
1334
|
return module2;
|
|
1330
1335
|
}
|
|
1336
|
+
static __to_binding(module2) {
|
|
1337
|
+
return module2.#inner;
|
|
1338
|
+
}
|
|
1331
1339
|
constructor(module2, compilation) {
|
|
1332
1340
|
this.#inner = module2;
|
|
1333
1341
|
Object.defineProperties(this, {
|
|
@@ -1547,6 +1555,25 @@ var cutOffByFlag = (stack, flag) => {
|
|
|
1547
1555
|
};
|
|
1548
1556
|
var cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
|
|
1549
1557
|
|
|
1558
|
+
// src/ModuleGraph.ts
|
|
1559
|
+
var ModuleGraph = class _ModuleGraph {
|
|
1560
|
+
static __from_binding(binding3) {
|
|
1561
|
+
return new _ModuleGraph(binding3);
|
|
1562
|
+
}
|
|
1563
|
+
#inner;
|
|
1564
|
+
constructor(binding3) {
|
|
1565
|
+
this.#inner = binding3;
|
|
1566
|
+
}
|
|
1567
|
+
getModule(dependency) {
|
|
1568
|
+
const binding3 = this.#inner.getModule(Dependency.__to_binding(dependency));
|
|
1569
|
+
return binding3 ? Module.__from_binding(binding3) : null;
|
|
1570
|
+
}
|
|
1571
|
+
getIssuer(module2) {
|
|
1572
|
+
const binding3 = this.#inner.getIssuer(Module.__to_binding(module2));
|
|
1573
|
+
return binding3 ? Module.__from_binding(binding3) : null;
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1550
1577
|
// src/util/index.ts
|
|
1551
1578
|
function isNil(value) {
|
|
1552
1579
|
return value === null || value === void 0;
|
|
@@ -2906,6 +2933,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2906
2933
|
this.childrenCounters = {};
|
|
2907
2934
|
this.children = [];
|
|
2908
2935
|
this.chunkGraph = new ChunkGraph(this);
|
|
2936
|
+
this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph);
|
|
2909
2937
|
}
|
|
2910
2938
|
get hash() {
|
|
2911
2939
|
return __privateGet(this, _inner).hash;
|
|
@@ -3613,6 +3641,18 @@ _Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER = 3e3;
|
|
|
3613
3641
|
_Compilation.PROCESS_ASSETS_STAGE_ANALYSE = 4e3;
|
|
3614
3642
|
_Compilation.PROCESS_ASSETS_STAGE_REPORT = 5e3;
|
|
3615
3643
|
var Compilation = _Compilation;
|
|
3644
|
+
var EntryData = class _EntryData {
|
|
3645
|
+
static __from_binding(binding3) {
|
|
3646
|
+
return new _EntryData(binding3);
|
|
3647
|
+
}
|
|
3648
|
+
constructor(binding3) {
|
|
3649
|
+
this.dependencies = binding3.dependencies.map(Dependency.__from_binding);
|
|
3650
|
+
this.includeDependencies = binding3.includeDependencies.map(
|
|
3651
|
+
Dependency.__from_binding
|
|
3652
|
+
);
|
|
3653
|
+
this.options = binding3.options;
|
|
3654
|
+
}
|
|
3655
|
+
};
|
|
3616
3656
|
var Entries = class {
|
|
3617
3657
|
#data;
|
|
3618
3658
|
constructor(data) {
|
|
@@ -3622,7 +3662,8 @@ var Entries = class {
|
|
|
3622
3662
|
this.#data.clear();
|
|
3623
3663
|
}
|
|
3624
3664
|
forEach(callback, thisArg) {
|
|
3625
|
-
for (const [key,
|
|
3665
|
+
for (const [key, binding3] of this) {
|
|
3666
|
+
const value = EntryData.__from_binding(binding3);
|
|
3626
3667
|
callback.call(thisArg, value, key, this);
|
|
3627
3668
|
}
|
|
3628
3669
|
}
|
|
@@ -3635,7 +3676,7 @@ var Entries = class {
|
|
|
3635
3676
|
}
|
|
3636
3677
|
}
|
|
3637
3678
|
values() {
|
|
3638
|
-
return this.#data.values()[Symbol.iterator]();
|
|
3679
|
+
return this.#data.values().map(EntryData.__from_binding)[Symbol.iterator]();
|
|
3639
3680
|
}
|
|
3640
3681
|
[Symbol.iterator]() {
|
|
3641
3682
|
return this.entries();
|
|
@@ -3654,7 +3695,8 @@ var Entries = class {
|
|
|
3654
3695
|
return this.#data.delete(key);
|
|
3655
3696
|
}
|
|
3656
3697
|
get(key) {
|
|
3657
|
-
|
|
3698
|
+
const binding3 = this.#data.get(key);
|
|
3699
|
+
return binding3 ? EntryData.__from_binding(binding3) : void 0;
|
|
3658
3700
|
}
|
|
3659
3701
|
keys() {
|
|
3660
3702
|
return this.#data.keys()[Symbol.iterator]();
|
|
@@ -12060,57 +12102,9 @@ var SizeLimitsPlugin = create2(
|
|
|
12060
12102
|
|
|
12061
12103
|
// src/builtin-plugin/SourceMapDevToolPlugin.ts
|
|
12062
12104
|
var import_binding64 = require("@rspack/binding");
|
|
12063
|
-
|
|
12064
|
-
// src/lib/ModuleFilenameHelpers.ts
|
|
12065
|
-
var ModuleFilenameHelpers_exports = {};
|
|
12066
|
-
__export(ModuleFilenameHelpers_exports, {
|
|
12067
|
-
asRegExp: () => asRegExp,
|
|
12068
|
-
matchObject: () => matchObject,
|
|
12069
|
-
matchPart: () => matchPart
|
|
12070
|
-
});
|
|
12071
|
-
var asRegExp = (test) => {
|
|
12072
|
-
if (typeof test === "string") {
|
|
12073
|
-
return new RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")}`);
|
|
12074
|
-
}
|
|
12075
|
-
return test;
|
|
12076
|
-
};
|
|
12077
|
-
var matchPart = (str, test) => {
|
|
12078
|
-
if (!test) return true;
|
|
12079
|
-
if (Array.isArray(test)) {
|
|
12080
|
-
return test.map(asRegExp).some((regExp) => regExp.test(str));
|
|
12081
|
-
}
|
|
12082
|
-
return asRegExp(test).test(str);
|
|
12083
|
-
};
|
|
12084
|
-
var matchObject = (obj, str) => {
|
|
12085
|
-
if (obj.test) {
|
|
12086
|
-
if (!matchPart(str, obj.test)) {
|
|
12087
|
-
return false;
|
|
12088
|
-
}
|
|
12089
|
-
}
|
|
12090
|
-
if (obj.include) {
|
|
12091
|
-
if (!matchPart(str, obj.include)) {
|
|
12092
|
-
return false;
|
|
12093
|
-
}
|
|
12094
|
-
}
|
|
12095
|
-
if (obj.exclude) {
|
|
12096
|
-
if (matchPart(str, obj.exclude)) {
|
|
12097
|
-
return false;
|
|
12098
|
-
}
|
|
12099
|
-
}
|
|
12100
|
-
return true;
|
|
12101
|
-
};
|
|
12102
|
-
|
|
12103
|
-
// src/builtin-plugin/SourceMapDevToolPlugin.ts
|
|
12104
12105
|
var SourceMapDevToolPlugin = create2(
|
|
12105
12106
|
import_binding64.BuiltinPluginName.SourceMapDevToolPlugin,
|
|
12106
|
-
(options) =>
|
|
12107
|
-
const { test, include, exclude, ...rest } = options;
|
|
12108
|
-
const rawOptions = rest;
|
|
12109
|
-
if (test || include || exclude) {
|
|
12110
|
-
rawOptions.test = (text) => matchObject({ test, include, exclude }, text);
|
|
12111
|
-
}
|
|
12112
|
-
return rawOptions;
|
|
12113
|
-
},
|
|
12107
|
+
(options) => options,
|
|
12114
12108
|
"compilation"
|
|
12115
12109
|
);
|
|
12116
12110
|
|
|
@@ -18368,6 +18362,45 @@ var RspackOptionsApply = class {
|
|
|
18368
18362
|
}
|
|
18369
18363
|
};
|
|
18370
18364
|
|
|
18365
|
+
// src/lib/ModuleFilenameHelpers.ts
|
|
18366
|
+
var ModuleFilenameHelpers_exports = {};
|
|
18367
|
+
__export(ModuleFilenameHelpers_exports, {
|
|
18368
|
+
asRegExp: () => asRegExp,
|
|
18369
|
+
matchObject: () => matchObject,
|
|
18370
|
+
matchPart: () => matchPart
|
|
18371
|
+
});
|
|
18372
|
+
var asRegExp = (test) => {
|
|
18373
|
+
if (typeof test === "string") {
|
|
18374
|
+
return new RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")}`);
|
|
18375
|
+
}
|
|
18376
|
+
return test;
|
|
18377
|
+
};
|
|
18378
|
+
var matchPart = (str, test) => {
|
|
18379
|
+
if (!test) return true;
|
|
18380
|
+
if (Array.isArray(test)) {
|
|
18381
|
+
return test.map(asRegExp).some((regExp) => regExp.test(str));
|
|
18382
|
+
}
|
|
18383
|
+
return asRegExp(test).test(str);
|
|
18384
|
+
};
|
|
18385
|
+
var matchObject = (obj, str) => {
|
|
18386
|
+
if (obj.test) {
|
|
18387
|
+
if (!matchPart(str, obj.test)) {
|
|
18388
|
+
return false;
|
|
18389
|
+
}
|
|
18390
|
+
}
|
|
18391
|
+
if (obj.include) {
|
|
18392
|
+
if (!matchPart(str, obj.include)) {
|
|
18393
|
+
return false;
|
|
18394
|
+
}
|
|
18395
|
+
}
|
|
18396
|
+
if (obj.exclude) {
|
|
18397
|
+
if (matchPart(str, obj.exclude)) {
|
|
18398
|
+
return false;
|
|
18399
|
+
}
|
|
18400
|
+
}
|
|
18401
|
+
return true;
|
|
18402
|
+
};
|
|
18403
|
+
|
|
18371
18404
|
// src/lib/DllPlugin.ts
|
|
18372
18405
|
var import_zod5 = __toESM(require("../compiled/zod/index.js"));
|
|
18373
18406
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@module-federation/runtime-tools": "0.5.1",
|
|
62
62
|
"@rspack/lite-tapable": "1.0.1",
|
|
63
63
|
"caniuse-lite": "^1.0.30001616",
|
|
64
|
-
"@rspack/binding": "1.1.
|
|
64
|
+
"@rspack/binding": "1.1.3"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@swc/helpers": ">=0.5.1"
|