@rspack/core 0.0.21 → 0.0.22
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/LICENSE +1 -1
- package/dist/ErrorHelpers.d.ts +8 -0
- package/dist/ErrorHelpers.d.ts.map +1 -0
- package/dist/ErrorHelpers.js +54 -0
- package/dist/ErrorHelpers.js.map +1 -0
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/ResolverFactory.d.ts.map +1 -1
- package/dist/ResolverFactory.js +9 -4
- package/dist/ResolverFactory.js.map +1 -1
- package/dist/compilation.d.ts +75 -5
- package/dist/compilation.d.ts.map +1 -1
- package/dist/compilation.js +256 -8
- package/dist/compilation.js.map +1 -1
- package/dist/compiler.d.ts +24 -11
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +97 -95
- package/dist/compiler.js.map +1 -1
- package/dist/config/browserslistTargetHandler.d.ts.map +1 -1
- package/dist/config/browserslistTargetHandler.js +9 -4
- package/dist/config/browserslistTargetHandler.js.map +1 -1
- package/dist/config/builtins.d.ts +14 -1
- package/dist/config/builtins.d.ts.map +1 -1
- package/dist/config/builtins.js +24 -3
- package/dist/config/builtins.js.map +1 -1
- package/dist/config/cache.d.ts.map +1 -1
- package/dist/config/cache.js +1 -0
- package/dist/config/cache.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +4 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/devServer.d.ts +2 -30
- package/dist/config/devServer.d.ts.map +1 -1
- package/dist/config/entry.d.ts +2 -1
- package/dist/config/entry.d.ts.map +1 -1
- package/dist/config/entry.js +24 -10
- package/dist/config/entry.js.map +1 -1
- package/dist/config/experiments.d.ts.map +1 -1
- package/dist/config/experiments.js +3 -2
- package/dist/config/experiments.js.map +1 -1
- package/dist/config/index.d.ts +15 -5
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +18 -16
- package/dist/config/index.js.map +1 -1
- package/dist/config/mode.d.ts +2 -2
- package/dist/config/mode.d.ts.map +1 -1
- package/dist/config/module.d.ts +16 -17
- package/dist/config/module.d.ts.map +1 -1
- package/dist/config/module.js +82 -25
- package/dist/config/module.js.map +1 -1
- package/dist/config/optimization.d.ts +23 -0
- package/dist/config/optimization.d.ts.map +1 -1
- package/dist/config/optimization.js +30 -4
- package/dist/config/optimization.js.map +1 -1
- package/dist/config/plugin.d.ts +1 -1
- package/dist/config/plugin.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +7 -3
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +16 -2
- package/dist/config/resolve.js.map +1 -1
- package/dist/config/splitChunks.d.ts +112 -0
- package/dist/config/splitChunks.d.ts.map +1 -0
- package/dist/config/splitChunks.js +41 -0
- package/dist/config/splitChunks.js.map +1 -0
- package/dist/config/stats.d.ts +3 -0
- package/dist/config/stats.d.ts.map +1 -1
- package/dist/config/stats.js +1 -0
- package/dist/config/stats.js.map +1 -1
- package/dist/config/watch.d.ts +3 -7
- package/dist/config/watch.d.ts.map +1 -1
- package/dist/config/watch.js +0 -13
- package/dist/config/watch.js.map +1 -1
- package/dist/error/ConcurrentCompilationError.d.ts +15 -0
- package/dist/error/ConcurrentCompilationError.d.ts.map +1 -0
- package/dist/error/ConcurrentCompilationError.js +21 -0
- package/dist/error/ConcurrentCompilationError.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/logging/Logger.d.ts +22 -6
- package/dist/logging/Logger.d.ts.map +1 -1
- package/dist/logging/Logger.js +9 -10
- package/dist/logging/Logger.js.map +1 -1
- package/dist/logging/createConsoleLogger.d.ts +9 -0
- package/dist/logging/createConsoleLogger.d.ts.map +1 -1
- package/dist/logging/createConsoleLogger.js +9 -4
- package/dist/logging/createConsoleLogger.js.map +1 -1
- package/dist/logging/runtime.d.ts +9 -0
- package/dist/logging/runtime.d.ts.map +1 -1
- package/dist/logging/runtime.js +17 -6
- package/dist/logging/runtime.js.map +1 -1
- package/dist/logging/truncateArgs.d.ts +9 -0
- package/dist/logging/truncateArgs.d.ts.map +1 -1
- package/dist/logging/truncateArgs.js +15 -5
- package/dist/logging/truncateArgs.js.map +1 -1
- package/dist/multiCompiler.d.ts +103 -0
- package/dist/multiCompiler.d.ts.map +1 -0
- package/dist/multiCompiler.js +454 -0
- package/dist/multiCompiler.js.map +1 -0
- package/dist/multiStats.d.ts +27 -0
- package/dist/multiStats.d.ts.map +1 -0
- package/dist/multiStats.js +133 -0
- package/dist/multiStats.js.map +1 -0
- package/dist/multiWatching.d.ts +36 -0
- package/dist/multiWatching.d.ts.map +1 -0
- package/dist/multiWatching.js +62 -0
- package/dist/multiWatching.js.map +1 -0
- package/dist/node/NodeEnvironmentPlugin.d.ts +8 -24
- package/dist/node/NodeEnvironmentPlugin.d.ts.map +1 -1
- package/dist/node/NodeEnvironmentPlugin.js +26 -29
- package/dist/node/NodeEnvironmentPlugin.js.map +1 -1
- package/dist/node/NodeTargetPlugin.d.ts +9 -0
- package/dist/node/NodeTargetPlugin.d.ts.map +1 -1
- package/dist/node/NodeTargetPlugin.js +9 -0
- package/dist/node/NodeTargetPlugin.js.map +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +19 -0
- package/dist/node/NodeWatchFileSystem.d.ts.map +1 -0
- package/dist/node/NodeWatchFileSystem.js +148 -0
- package/dist/node/NodeWatchFileSystem.js.map +1 -0
- package/dist/node/nodeConsole.d.ts +10 -1
- package/dist/node/nodeConsole.d.ts.map +1 -1
- package/dist/node/nodeConsole.js +42 -25
- package/dist/node/nodeConsole.js.map +1 -1
- package/dist/rspack.d.ts +5 -1
- package/dist/rspack.d.ts.map +1 -1
- package/dist/rspack.js +32 -2
- package/dist/rspack.js.map +1 -1
- package/dist/rspackOptionsApply.d.ts.map +1 -1
- package/dist/rspackOptionsApply.js +7 -0
- package/dist/rspackOptionsApply.js.map +1 -1
- package/dist/stats.d.ts +16 -10
- package/dist/stats.d.ts.map +1 -1
- package/dist/stats.js +58 -51
- package/dist/stats.js.map +1 -1
- package/dist/util/ArrayQueue.d.ts +54 -0
- package/dist/util/ArrayQueue.d.ts.map +1 -0
- package/dist/util/ArrayQueue.js +109 -0
- package/dist/util/ArrayQueue.js.map +1 -0
- package/dist/util/cleverMerge.d.ts.map +1 -1
- package/dist/util/cleverMerge.js +9 -4
- package/dist/util/cleverMerge.js.map +1 -1
- package/dist/util/createHash.d.ts +9 -0
- package/dist/util/createHash.d.ts.map +1 -1
- package/dist/util/createHash.js +9 -4
- package/dist/util/createHash.js.map +1 -1
- package/dist/util/createSource.d.ts.map +1 -1
- package/dist/util/createSource.js +19 -4
- package/dist/util/createSource.js.map +1 -1
- package/dist/util/fake.d.ts +29 -0
- package/dist/util/fake.d.ts.map +1 -0
- package/dist/util/fake.js +69 -0
- package/dist/util/fake.js.map +1 -0
- package/dist/util/fs.d.ts +24 -0
- package/dist/util/fs.d.ts.map +1 -0
- package/dist/util/fs.js +3 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/hash/BatchedHash.d.ts +2 -2
- package/dist/util/hash/BatchedHash.d.ts.map +1 -1
- package/dist/util/hash/BatchedHash.js +9 -4
- package/dist/util/hash/BatchedHash.js.map +1 -1
- package/dist/util/hash/md4.d.ts +1 -1
- package/dist/util/hash/md4.js +9 -4
- package/dist/util/hash/md4.js.map +1 -1
- package/dist/util/hash/wasm-hash.d.ts.map +1 -1
- package/dist/util/hash/wasm-hash.js +9 -4
- package/dist/util/hash/wasm-hash.js.map +1 -1
- package/dist/util/hash/xxhash64.d.ts +1 -1
- package/dist/util/hash/xxhash64.js +9 -4
- package/dist/util/hash/xxhash64.js.map +1 -1
- package/dist/util/identifier.d.ts +8 -8
- package/dist/util/identifier.d.ts.map +1 -1
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +10 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/memoize.d.ts.map +1 -1
- package/dist/util/memoize.js +3 -0
- package/dist/util/memoize.js.map +1 -1
- package/dist/watching.d.ts +32 -0
- package/dist/watching.d.ts.map +1 -0
- package/dist/watching.js +282 -0
- package/dist/watching.js.map +1 -0
- package/package.json +16 -12
- package/dist/utils/createHash.d.ts +0 -7
- package/dist/utils/createHash.d.ts.map +0 -1
- package/dist/utils/createHash.js +0 -166
- package/dist/utils/createHash.js.map +0 -1
- package/dist/utils/createSource.d.ts +0 -6
- package/dist/utils/createSource.d.ts.map +0 -1
- package/dist/utils/createSource.js +0 -48
- package/dist/utils/createSource.js.map +0 -1
- package/dist/utils/hash/BatchedHash.d.ts +0 -16
- package/dist/utils/hash/BatchedHash.d.ts.map +0 -1
- package/dist/utils/hash/BatchedHash.js +0 -61
- package/dist/utils/hash/BatchedHash.js.map +0 -1
- package/dist/utils/hash/index.d.ts +0 -19
- package/dist/utils/hash/index.d.ts.map +0 -1
- package/dist/utils/hash/index.js +0 -28
- package/dist/utils/hash/index.js.map +0 -1
- package/dist/utils/hash/md4.d.ts +0 -3
- package/dist/utils/hash/md4.d.ts.map +0 -1
- package/dist/utils/hash/md4.js +0 -13
- package/dist/utils/hash/md4.js.map +0 -1
- package/dist/utils/hash/wasm-hash.d.ts +0 -7
- package/dist/utils/hash/wasm-hash.d.ts.map +0 -1
- package/dist/utils/hash/wasm-hash.js +0 -162
- package/dist/utils/hash/wasm-hash.js.map +0 -1
- package/dist/utils/hash/xxhash64.d.ts +0 -3
- package/dist/utils/hash/xxhash64.d.ts.map +0 -1
- package/dist/utils/hash/xxhash64.js +0 -13
- package/dist/utils/hash/xxhash64.js.map +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -18
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/memoize.d.ts +0 -2
- package/dist/utils/memoize.d.ts.map +0 -1
- package/dist/utils/memoize.js +0 -22
- package/dist/utils/memoize.js.map +0 -1
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/nodeConsole.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
1
10
|
declare const _default: ({ colors, appendOnly, stream }: {
|
|
2
11
|
colors: any;
|
|
3
12
|
appendOnly: any;
|
|
@@ -15,7 +24,7 @@ declare const _default: ({ colors, appendOnly, stream }: {
|
|
|
15
24
|
groupEnd: () => void;
|
|
16
25
|
profile: (name: any) => void;
|
|
17
26
|
profileEnd: (name: any) => void;
|
|
18
|
-
clear: () => void;
|
|
27
|
+
clear: false | (() => void);
|
|
19
28
|
status: (...args: any[]) => void;
|
|
20
29
|
};
|
|
21
30
|
export = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeConsole.d.ts","sourceRoot":"","sources":["../../src/node/nodeConsole.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeConsole.d.ts","sourceRoot":"","sources":["../../src/node/nodeConsole.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;AAKH,kBA8IE"}
|
package/dist/node/nodeConsole.js
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The following code is modified based on
|
|
4
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/nodeConsole.js
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
* Author Tobias Koppers @sokra
|
|
8
|
+
* Copyright (c) JS Foundation and other contributors
|
|
9
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
10
|
+
*/
|
|
6
11
|
const util = require("util");
|
|
7
12
|
const truncateArgs = require("../logging/truncateArgs");
|
|
8
13
|
module.exports = ({ colors, appendOnly, stream }) => {
|
|
14
|
+
// @ts-expect-error
|
|
9
15
|
let currentStatusMessage = undefined;
|
|
10
16
|
let hasStatusMessage = false;
|
|
11
17
|
let currentIndent = "";
|
|
12
18
|
let currentCollapsed = 0;
|
|
19
|
+
// @ts-expect-error
|
|
13
20
|
const indent = (str, prefix, colorPrefix, colorSuffix) => {
|
|
14
21
|
if (str === "")
|
|
15
22
|
return str;
|
|
@@ -31,18 +38,23 @@ module.exports = ({ colors, appendOnly, stream }) => {
|
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
const writeStatusMessage = () => {
|
|
41
|
+
// @ts-expect-error
|
|
34
42
|
if (!currentStatusMessage)
|
|
35
43
|
return;
|
|
36
44
|
const l = stream.columns;
|
|
37
45
|
const args = l
|
|
38
|
-
?
|
|
39
|
-
|
|
46
|
+
? // @ts-ignore
|
|
47
|
+
truncateArgs(currentStatusMessage, l - 1)
|
|
48
|
+
: // @ts-ignore
|
|
49
|
+
currentStatusMessage;
|
|
40
50
|
const str = args.join(" ");
|
|
41
51
|
const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`;
|
|
42
52
|
stream.write(`\x1b[2K\r${coloredStr}`);
|
|
43
53
|
hasStatusMessage = true;
|
|
44
54
|
};
|
|
55
|
+
// @ts-expect-error
|
|
45
56
|
const writeColored = (prefix, colorPrefix, colorSuffix) => {
|
|
57
|
+
// @ts-expect-error
|
|
46
58
|
return (...args) => {
|
|
47
59
|
if (currentCollapsed > 0)
|
|
48
60
|
return;
|
|
@@ -62,6 +74,7 @@ module.exports = ({ colors, appendOnly, stream }) => {
|
|
|
62
74
|
warn: writeColored("<w> ", "\u001b[1m\u001b[33m", "\u001b[39m\u001b[22m"),
|
|
63
75
|
error: writeColored("<e> ", "\u001b[1m\u001b[31m", "\u001b[39m\u001b[22m"),
|
|
64
76
|
logTime: writeColored("<t> ", "\u001b[1m\u001b[35m", "\u001b[39m\u001b[22m"),
|
|
77
|
+
// @ts-expect-error
|
|
65
78
|
group: (...args) => {
|
|
66
79
|
writeGroupMessage(...args);
|
|
67
80
|
if (currentCollapsed > 0) {
|
|
@@ -71,6 +84,7 @@ module.exports = ({ colors, appendOnly, stream }) => {
|
|
|
71
84
|
currentIndent += " ";
|
|
72
85
|
}
|
|
73
86
|
},
|
|
87
|
+
// @ts-expect-error
|
|
74
88
|
groupCollapsed: (...args) => {
|
|
75
89
|
writeGroupCollapsedMessage(...args);
|
|
76
90
|
currentCollapsed++;
|
|
@@ -82,8 +96,10 @@ module.exports = ({ colors, appendOnly, stream }) => {
|
|
|
82
96
|
currentIndent = currentIndent.slice(0, currentIndent.length - 2);
|
|
83
97
|
},
|
|
84
98
|
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
99
|
+
// @ts-expect-error
|
|
85
100
|
profile: console.profile && (name => console.profile(name)),
|
|
86
101
|
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
102
|
+
// @ts-expect-error
|
|
87
103
|
profileEnd: console.profileEnd && (name => console.profileEnd(name)),
|
|
88
104
|
clear: !appendOnly &&
|
|
89
105
|
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
@@ -96,26 +112,27 @@ module.exports = ({ colors, appendOnly, stream }) => {
|
|
|
96
112
|
}),
|
|
97
113
|
status: appendOnly
|
|
98
114
|
? writeColored("<s> ", "", "")
|
|
99
|
-
:
|
|
100
|
-
args
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
115
|
+
: // @ts-expect-error
|
|
116
|
+
(name, ...args) => {
|
|
117
|
+
args = args.filter(Boolean);
|
|
118
|
+
if (name === undefined && args.length === 0) {
|
|
119
|
+
clearStatusMessage();
|
|
120
|
+
currentStatusMessage = undefined;
|
|
121
|
+
}
|
|
122
|
+
else if (typeof name === "string" &&
|
|
123
|
+
name.startsWith("[webpack.Progress] ")) {
|
|
124
|
+
currentStatusMessage = [name.slice(19), ...args];
|
|
125
|
+
writeStatusMessage();
|
|
126
|
+
}
|
|
127
|
+
else if (name === "[webpack.Progress]") {
|
|
128
|
+
currentStatusMessage = [...args];
|
|
129
|
+
writeStatusMessage();
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
currentStatusMessage = [name, ...args];
|
|
133
|
+
writeStatusMessage();
|
|
134
|
+
}
|
|
104
135
|
}
|
|
105
|
-
else if (typeof name === "string" &&
|
|
106
|
-
name.startsWith("[webpack.Progress] ")) {
|
|
107
|
-
currentStatusMessage = [name.slice(19), ...args];
|
|
108
|
-
writeStatusMessage();
|
|
109
|
-
}
|
|
110
|
-
else if (name === "[webpack.Progress]") {
|
|
111
|
-
currentStatusMessage = [...args];
|
|
112
|
-
writeStatusMessage();
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
currentStatusMessage = [name, ...args];
|
|
116
|
-
writeStatusMessage();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
136
|
};
|
|
120
137
|
};
|
|
121
138
|
//# sourceMappingURL=nodeConsole.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeConsole.js","sourceRoot":"","sources":["../../src/node/nodeConsole.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"nodeConsole.js","sourceRoot":"","sources":["../../src/node/nodeConsole.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAExD,iBAAS,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;IAC3C,mBAAmB;IACnB,IAAI,oBAAoB,GAAG,SAAS,CAAC;IACrC,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,aAAa,GAAG,EA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AC,CAAC;oBAC5B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC5C,kBAAkB,EAAE,CAAC;wBACrB,oBAAoB,GAAG,SAAS,CAAC;qBACjC;yBAAM,IACN,OAAO,IAAI,KAAK,QAAQ;wBACxB,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,EACrC;wBACD,oBAAoB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;wBACjD,kBAAkB,EAAE,CAAC;qBACrB;yBAAM,IAAI,IAAI,KAAK,oBAAoB,EAAE;wBACzC,oBAAoB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;wBACjC,kBAAkB,EAAE,CAAC;qBACrB;yBAAM;wBACN,oBAAoB,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;wBACvC,kBAAkB,EAAE,CAAC;qBACrB;gBACD,CAAC;KACJ,CAAC;AACH,CAAC,CAAC"}
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { RspackOptions } from "./config";
|
|
2
2
|
import { Compiler } from "./compiler";
|
|
3
3
|
import { Stats } from "./stats";
|
|
4
|
+
import { MultiCompiler, MultiCompilerOptions } from "./multiCompiler";
|
|
5
|
+
import MultiStats from "./multiStats";
|
|
4
6
|
declare type Callback<T> = (err: Error, t: T) => void;
|
|
7
|
+
declare function createMultiCompiler(options: MultiCompilerOptions): MultiCompiler;
|
|
5
8
|
declare function createCompiler(userOptions: RspackOptions): Compiler;
|
|
9
|
+
declare function rspack(options: MultiCompilerOptions, callback?: Callback<MultiStats>): MultiCompiler;
|
|
6
10
|
declare function rspack(options: RspackOptions, callback?: Callback<Stats>): Compiler;
|
|
7
|
-
export { rspack, createCompiler };
|
|
11
|
+
export { rspack, createCompiler, createMultiCompiler };
|
|
8
12
|
//# sourceMappingURL=rspack.d.ts.map
|
package/dist/rspack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,aAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,aAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;AAE9C,iBAAS,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CA0BzE;AAED,iBAAS,cAAc,CAAC,WAAW,EAAE,aAAa,GAAG,QAAQ,CAoC5D;AAED,iBAAS,MAAM,CACd,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,GAC7B,aAAa,CAAC;AACjB,iBAAS,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;AAmB9E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/rspack.js
CHANGED
|
@@ -3,13 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createCompiler = exports.rspack = void 0;
|
|
6
|
+
exports.createMultiCompiler = exports.createCompiler = exports.rspack = void 0;
|
|
7
7
|
const config_1 = require("./config");
|
|
8
8
|
const compiler_1 = require("./compiler");
|
|
9
9
|
const defaults_1 = require("./config/defaults");
|
|
10
10
|
const util_1 = __importDefault(require("util"));
|
|
11
11
|
const rspackOptionsApply_1 = require("./rspackOptionsApply");
|
|
12
12
|
const NodeEnvironmentPlugin_1 = __importDefault(require("./node/NodeEnvironmentPlugin"));
|
|
13
|
+
const multiCompiler_1 = require("./multiCompiler");
|
|
14
|
+
function createMultiCompiler(options) {
|
|
15
|
+
const compilers = options.map(option => {
|
|
16
|
+
const compiler = createCompiler(option);
|
|
17
|
+
/**
|
|
18
|
+
* Missing features: WebpackOptionsApply
|
|
19
|
+
* `compiler.name` should be set by WebpackOptionsApply.
|
|
20
|
+
*/
|
|
21
|
+
// @ts-expect-error
|
|
22
|
+
compiler.name = option.name;
|
|
23
|
+
return compiler;
|
|
24
|
+
});
|
|
25
|
+
const compiler = new multiCompiler_1.MultiCompiler(compilers, options);
|
|
26
|
+
for (const childCompiler of compilers) {
|
|
27
|
+
if (childCompiler.options.dependencies) {
|
|
28
|
+
compiler.setDependencies(childCompiler, childCompiler.options.dependencies);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return compiler;
|
|
32
|
+
}
|
|
33
|
+
exports.createMultiCompiler = createMultiCompiler;
|
|
13
34
|
function createCompiler(userOptions) {
|
|
14
35
|
// console.log("user:", userOptions);
|
|
15
36
|
const options = (0, config_1.getNormalizedRspackOptions)(userOptions, () => compiler);
|
|
@@ -32,14 +53,23 @@ function createCompiler(userOptions) {
|
|
|
32
53
|
}
|
|
33
54
|
(0, defaults_1.applyRspackOptionsDefaults)(compiler.options);
|
|
34
55
|
logger.debug("NormalizedOptions:", util_1.default.inspect(compiler.options, { colors: true, depth: null }));
|
|
56
|
+
compiler.hooks.environment.call();
|
|
57
|
+
compiler.hooks.afterEnvironment.call();
|
|
35
58
|
new rspackOptionsApply_1.RspackOptionsApply().process(compiler.options, compiler);
|
|
36
59
|
compiler.hooks.initialize.call();
|
|
37
60
|
return compiler;
|
|
38
61
|
}
|
|
39
62
|
exports.createCompiler = createCompiler;
|
|
40
63
|
function rspack(options, callback) {
|
|
41
|
-
let compiler
|
|
64
|
+
let compiler;
|
|
65
|
+
if (Array.isArray(options)) {
|
|
66
|
+
compiler = createMultiCompiler(options);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
compiler = createCompiler(options);
|
|
70
|
+
}
|
|
42
71
|
if (callback) {
|
|
72
|
+
// @ts-expect-error
|
|
43
73
|
compiler.run(callback);
|
|
44
74
|
return compiler;
|
|
45
75
|
}
|
package/dist/rspack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAqE;AACrE,yCAAsC;AACtC,gDAG2B;AAE3B,gDAAwB;AAExB,6DAA0D;AAC1D,yFAAiE;
|
|
1
|
+
{"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAqE;AACrE,yCAAsC;AACtC,gDAG2B;AAE3B,gDAAwB;AAExB,6DAA0D;AAC1D,yFAAiE;AACjE,mDAAsE;AAItE,SAAS,mBAAmB,CAAC,OAA6B;IACzD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACtC,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAExC;;;WAGG;QACH,mBAAmB;QACnB,QAAQ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M,GAAG,CAAC;AAMtD,qBAAa,kBAAkB;;IAE9B,OAAO,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"rspackOptionsApply.d.ts","sourceRoot":"","sources":["../src/rspackOptionsApply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAMtD,qBAAa,kBAAkB;;IAE9B,OAAO,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;CA6C5D"}
|
|
@@ -11,15 +11,20 @@ const cleverMerge_1 = require("./util/cleverMerge");
|
|
|
11
11
|
class RspackOptionsApply {
|
|
12
12
|
constructor() { }
|
|
13
13
|
process(options, compiler) {
|
|
14
|
+
// @ts-expect-error
|
|
14
15
|
compiler.outputPath = options.output.path;
|
|
16
|
+
// @ts-expect-error
|
|
15
17
|
compiler.name = options.name;
|
|
16
18
|
compiler.outputFileSystem = graceful_fs_1.default;
|
|
17
19
|
if (compiler.options.target.includes("node")) {
|
|
18
20
|
new NodeTargetPlugin_1.NodeTargetPlugin().apply(compiler);
|
|
19
21
|
}
|
|
20
22
|
// after we migrate minify to minimze, we could remove it
|
|
23
|
+
// @ts-expect-error
|
|
21
24
|
if (options.optimization.minimize || options.builtins.minify) {
|
|
25
|
+
// @ts-expect-error
|
|
22
26
|
if (options.optimization.minimizer) {
|
|
27
|
+
// @ts-expect-error
|
|
23
28
|
for (const minimizer of options.optimization.minimizer) {
|
|
24
29
|
if (minimizer !== "...") {
|
|
25
30
|
minimizer.apply(compiler);
|
|
@@ -28,6 +33,7 @@ class RspackOptionsApply {
|
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
new ResolveSwcPlugin_1.ResolveSwcPlugin().apply(compiler);
|
|
36
|
+
compiler.hooks.afterPlugins.call(compiler);
|
|
31
37
|
if (!compiler.inputFileSystem) {
|
|
32
38
|
throw new Error("No input filesystem provided");
|
|
33
39
|
}
|
|
@@ -46,6 +52,7 @@ class RspackOptionsApply {
|
|
|
46
52
|
resolveOptions.resolveToContext = true;
|
|
47
53
|
return resolveOptions;
|
|
48
54
|
});
|
|
55
|
+
compiler.hooks.afterResolvers.call(compiler);
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
exports.RspackOptionsApply = RspackOptionsApply;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspackOptionsApply.js","sourceRoot":"","sources":["../src/rspackOptionsApply.ts"],"names":[],"mappings":";;;;;;AACA,8DAA6B;AAE7B,8DAA2D;AAC3D,6DAA0D;AAC1D,oDAAiD;AACjD,MAAa,kBAAkB;IAC9B,gBAAe,CAAC;IAChB,OAAO,CAAC,OAAgC,EAAE,QAAkB;QAC3D,QAAQ,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;QAC1C,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,QAAQ,CAAC,gBAAgB,GAAG,qBAAE,CAAC;QAC/B,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC7C,IAAI,mCAAgB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACvC;QACD,yDAAyD;QACzD,IAAI,OAAO,CAAC,YAAY,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC7D,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE;gBACnC,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE;oBACvD,IAAI,SAAS,KAAK,KAAK,EAAE;wBACxB,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;qBAC1B;iBACD;aACD;SACD;QACD,IAAI,mCAAgB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEvC,IAAI,CAAC,QAAQ,CA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,CAAC,CAAC;YAC9D,cAAc,CAAC,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC;YACrD,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC;YACvC,OAAO,cAAc,CAAC;QACvB,CAAC,CAAC,CAAC;QACJ,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;CACD;AA/CD,gDA+CC"}
|
package/dist/stats.d.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import * as binding from "@rspack/binding";
|
|
2
2
|
import { Compilation } from ".";
|
|
3
3
|
import { StatsOptions, StatsOptionsObj } from "./config/stats";
|
|
4
|
-
declare type
|
|
4
|
+
export declare type StatsCompilation = Partial<Omit<binding.JsStatsCompilation, "entrypoints"> & {
|
|
5
5
|
entrypoints: Record<string, binding.JsStatsEntrypoint>;
|
|
6
|
-
};
|
|
7
|
-
export declare type StatsCompilation = Partial<StatsCompilationInner> & {
|
|
8
6
|
filteredModules?: number;
|
|
9
|
-
|
|
7
|
+
publicPath?: string;
|
|
8
|
+
children?: StatsCompilation[];
|
|
9
|
+
name?: string;
|
|
10
|
+
}>;
|
|
10
11
|
export declare class Stats {
|
|
11
12
|
#private;
|
|
12
13
|
compilation: Compilation;
|
|
13
|
-
constructor(
|
|
14
|
+
constructor(compilation: Compilation);
|
|
14
15
|
get hash(): string;
|
|
15
16
|
hasErrors(): boolean;
|
|
16
17
|
hasWarnings(): boolean;
|
|
17
|
-
toJson(opts?: StatsOptions, forToString?: boolean):
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
toJson(opts?: StatsOptions, forToString?: boolean): Partial<Omit<binding.JsStatsCompilation, "entrypoints"> & {
|
|
19
|
+
entrypoints: Record<string, binding.JsStatsEntrypoint>;
|
|
20
|
+
filteredModules?: number | undefined;
|
|
21
|
+
publicPath?: string | undefined;
|
|
22
|
+
children?: Partial<Omit<binding.JsStatsCompilation, "entrypoints"> & any>[] | undefined;
|
|
23
|
+
name?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
toString(opts?: StatsOptions): any;
|
|
26
|
+
static jsonToString(obj: any, useColors: boolean): any;
|
|
20
27
|
}
|
|
21
|
-
export declare const optionsOrFallback: (...args:
|
|
28
|
+
export declare const optionsOrFallback: (...args: (boolean | undefined)[]) => boolean | undefined;
|
|
22
29
|
export declare function normalizeStatsPreset(options?: StatsOptions): StatsOptionsObj;
|
|
23
|
-
export {};
|
|
24
30
|
//# sourceMappingURL=stats.d.ts.map
|
package/dist/stats.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG/D,
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG/D,oBAAY,gBAAgB,GAAG,OAAO,CACrC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG;IACjD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CACD,CAAC;AAEF,qBAAa,KAAK;;IAEjB,WAAW,EAAE,WAAW,CAAC;gBAEb,WAAW,EAAE,WAAW;IAKpC,IAAI,IAAI,WAEP;IAED,SAAS;IAIT,WAAW;IAIX,MAAM,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,OAAO;;;;;;;IA+CjD,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY;IAW5B,MAAM,CAAC,YAAY,CAAC,GAAG,KAAA,EAAE,SAAS,EAAE,OAAO;CA4wB3C;AAyBD,eAAO,MAAM,iBAAiB,YAAa,CAAC,OAAO,GAAG,SAAS,CAAC,EAAE,wBAIjE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAS5E"}
|
package/dist/stats.js
CHANGED
|
@@ -10,72 +10,63 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _Stats_inner;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.normalizeStatsPreset = exports.optionsOrFallback = exports.Stats = void 0;
|
|
16
16
|
const Logger_1 = require("./logging/Logger");
|
|
17
17
|
class Stats {
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__classPrivateFieldSet(this, _Stats_statsJson, {
|
|
22
|
-
...statsJson,
|
|
23
|
-
entrypoints: statsJson.entrypoints.reduce((acc, cur) => {
|
|
24
|
-
acc[cur.name] = cur;
|
|
25
|
-
return acc;
|
|
26
|
-
}, {})
|
|
27
|
-
}, "f");
|
|
18
|
+
constructor(compilation) {
|
|
19
|
+
_Stats_inner.set(this, void 0);
|
|
20
|
+
__classPrivateFieldSet(this, _Stats_inner, compilation.__internal_getInner().getStats(), "f");
|
|
28
21
|
this.compilation = compilation;
|
|
29
22
|
}
|
|
30
23
|
get hash() {
|
|
31
24
|
return this.compilation.hash;
|
|
32
25
|
}
|
|
33
26
|
hasErrors() {
|
|
34
|
-
return __classPrivateFieldGet(this,
|
|
27
|
+
return __classPrivateFieldGet(this, _Stats_inner, "f").getErrors().length > 0;
|
|
35
28
|
}
|
|
36
29
|
hasWarnings() {
|
|
37
|
-
return __classPrivateFieldGet(this,
|
|
30
|
+
return __classPrivateFieldGet(this, _Stats_inner, "f").getWarnings().length > 0;
|
|
38
31
|
}
|
|
39
32
|
toJson(opts, forToString) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const showModules = optionOrLocalFallback(options.modules, true);
|
|
46
|
-
const showEntrypoints = optionOrLocalFallback(options.entrypoints, true);
|
|
47
|
-
const showErrors = optionOrLocalFallback(options.errors, true);
|
|
48
|
-
const showErrorsCount = optionOrLocalFallback(options.errorsCount, true);
|
|
49
|
-
const showWarninigs = optionOrLocalFallback(options.warnings, true);
|
|
50
|
-
const showWarningsCount = optionOrLocalFallback(options.warningsCount, true);
|
|
51
|
-
const showHash = optionOrLocalFallback(options.hash, false);
|
|
33
|
+
var _a, _b;
|
|
34
|
+
// @ts-expect-error
|
|
35
|
+
const options = this.compilation.createStatsOptions(opts, {
|
|
36
|
+
forToString
|
|
37
|
+
});
|
|
52
38
|
let obj = {};
|
|
53
|
-
if (
|
|
54
|
-
obj.hash = __classPrivateFieldGet(this,
|
|
39
|
+
if (options.hash) {
|
|
40
|
+
obj.hash = __classPrivateFieldGet(this, _Stats_inner, "f").getHash();
|
|
55
41
|
}
|
|
56
|
-
if (
|
|
57
|
-
obj.assets = __classPrivateFieldGet(this,
|
|
42
|
+
if (options.assets) {
|
|
43
|
+
obj.assets = __classPrivateFieldGet(this, _Stats_inner, "f").getAssets();
|
|
58
44
|
}
|
|
59
|
-
if (
|
|
60
|
-
obj.chunks = __classPrivateFieldGet(this,
|
|
45
|
+
if (options.chunks) {
|
|
46
|
+
obj.chunks = __classPrivateFieldGet(this, _Stats_inner, "f").getChunks();
|
|
61
47
|
}
|
|
62
|
-
if (
|
|
63
|
-
|
|
48
|
+
if (options.modules) {
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
obj.modules = __classPrivateFieldGet(this, _Stats_inner, "f").getModules(options.reasons);
|
|
64
51
|
}
|
|
65
|
-
if (
|
|
66
|
-
obj.entrypoints = __classPrivateFieldGet(this,
|
|
52
|
+
if (options.entrypoints) {
|
|
53
|
+
obj.entrypoints = __classPrivateFieldGet(this, _Stats_inner, "f").getEntrypoints().reduce((acc, cur) => {
|
|
54
|
+
// @ts-expect-error
|
|
55
|
+
acc[cur.name] = cur;
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
67
58
|
}
|
|
68
|
-
if (
|
|
69
|
-
obj.errors = __classPrivateFieldGet(this,
|
|
59
|
+
if (options.errors) {
|
|
60
|
+
obj.errors = __classPrivateFieldGet(this, _Stats_inner, "f").getErrors();
|
|
70
61
|
}
|
|
71
|
-
if (
|
|
72
|
-
obj.errorsCount = __classPrivateFieldGet(this,
|
|
62
|
+
if (options.errorsCount) {
|
|
63
|
+
obj.errorsCount = ((_a = obj.errors) !== null && _a !== void 0 ? _a : __classPrivateFieldGet(this, _Stats_inner, "f").getErrors()).length;
|
|
73
64
|
}
|
|
74
|
-
if (
|
|
75
|
-
obj.warnings = __classPrivateFieldGet(this,
|
|
65
|
+
if (options.warnings) {
|
|
66
|
+
obj.warnings = __classPrivateFieldGet(this, _Stats_inner, "f").getWarnings();
|
|
76
67
|
}
|
|
77
|
-
if (
|
|
78
|
-
obj.warningsCount = __classPrivateFieldGet(this,
|
|
68
|
+
if (options.warningsCount) {
|
|
69
|
+
obj.warningsCount = ((_b = obj.warnings) !== null && _b !== void 0 ? _b : __classPrivateFieldGet(this, _Stats_inner, "f").getWarnings()).length;
|
|
79
70
|
}
|
|
80
71
|
if (obj.modules && forToString) {
|
|
81
72
|
obj.filteredModules = obj.modules.length - 15;
|
|
@@ -84,11 +75,16 @@ class Stats {
|
|
|
84
75
|
return obj;
|
|
85
76
|
}
|
|
86
77
|
toString(opts) {
|
|
87
|
-
|
|
78
|
+
// @ts-expect-error
|
|
79
|
+
const options = this.compilation.createStatsOptions(opts, {
|
|
80
|
+
forToString: true
|
|
81
|
+
});
|
|
88
82
|
const useColors = (0, exports.optionsOrFallback)(options.colors, false);
|
|
89
83
|
const obj = this.toJson(options, true);
|
|
84
|
+
// @ts-expect-error
|
|
90
85
|
return Stats.jsonToString(obj, useColors);
|
|
91
86
|
}
|
|
87
|
+
// @ts-expect-error
|
|
92
88
|
static jsonToString(obj, useColors) {
|
|
93
89
|
var _a, _b, _c;
|
|
94
90
|
const buf = [];
|
|
@@ -101,10 +97,12 @@ class Stats {
|
|
|
101
97
|
magenta: "\u001b[1m\u001b[35m"
|
|
102
98
|
};
|
|
103
99
|
const colors = Object.keys(defaultColors).reduce((obj, color) => {
|
|
100
|
+
// @ts-expect-error
|
|
104
101
|
obj[color] = str => {
|
|
105
102
|
if (useColors) {
|
|
106
103
|
buf.push(useColors === true || useColors[color] === undefined
|
|
107
|
-
?
|
|
104
|
+
? // @ts-expect-error
|
|
105
|
+
defaultColors[color]
|
|
108
106
|
: useColors[color]);
|
|
109
107
|
}
|
|
110
108
|
buf.push(str);
|
|
@@ -114,9 +112,10 @@ class Stats {
|
|
|
114
112
|
};
|
|
115
113
|
return obj;
|
|
116
114
|
}, {
|
|
115
|
+
// @ts-expect-error
|
|
117
116
|
normal: str => buf.push(str)
|
|
118
117
|
});
|
|
119
|
-
const coloredTime = time => {
|
|
118
|
+
const coloredTime = (time) => {
|
|
120
119
|
let times = [800, 400, 200, 100];
|
|
121
120
|
if (obj.time) {
|
|
122
121
|
times = [obj.time / 2, obj.time / 4, obj.time / 8, obj.time / 16];
|
|
@@ -145,6 +144,7 @@ class Stats {
|
|
|
145
144
|
}
|
|
146
145
|
for (let row = 0; row < rows; row++) {
|
|
147
146
|
for (let col = 0; col < cols; col++) {
|
|
147
|
+
// @ts-expect-error
|
|
148
148
|
const value = `${getText(array, row, col)}`;
|
|
149
149
|
if (value.length > colSizes[col]) {
|
|
150
150
|
colSizes[col] = value.length;
|
|
@@ -154,6 +154,7 @@ class Stats {
|
|
|
154
154
|
for (let row = 0; row < rows; row++) {
|
|
155
155
|
for (let col = 0; col < cols; col++) {
|
|
156
156
|
const format = array[row][col].color;
|
|
157
|
+
// @ts-expect-error
|
|
157
158
|
const value = `${getText(array, row, col)}`;
|
|
158
159
|
let l = value.length;
|
|
159
160
|
if (align[col] === "l") {
|
|
@@ -184,7 +185,7 @@ class Stats {
|
|
|
184
185
|
newline();
|
|
185
186
|
}
|
|
186
187
|
if (obj.version) {
|
|
187
|
-
colors.normal("Version:
|
|
188
|
+
colors.normal("Version: rspack ");
|
|
188
189
|
colors.bold(obj.version);
|
|
189
190
|
newline();
|
|
190
191
|
}
|
|
@@ -339,6 +340,7 @@ class Stats {
|
|
|
339
340
|
outputChunkGroups = Object.keys(outputChunkGroups)
|
|
340
341
|
.filter(name => !obj.entrypoints[name])
|
|
341
342
|
.reduce((result, name) => {
|
|
343
|
+
// @ts-expect-error
|
|
342
344
|
result[name] = obj.namedChunkGroups[name];
|
|
343
345
|
return result;
|
|
344
346
|
}, {});
|
|
@@ -348,6 +350,7 @@ class Stats {
|
|
|
348
350
|
const modulesByIdentifier = {};
|
|
349
351
|
if (obj.modules) {
|
|
350
352
|
for (const module of obj.modules) {
|
|
353
|
+
// @ts-expect-error
|
|
351
354
|
modulesByIdentifier[`$${module.identifier}`] = module;
|
|
352
355
|
}
|
|
353
356
|
}
|
|
@@ -355,12 +358,13 @@ class Stats {
|
|
|
355
358
|
for (const chunk of obj.chunks) {
|
|
356
359
|
if (chunk.modules) {
|
|
357
360
|
for (const module of chunk.modules) {
|
|
361
|
+
// @ts-expect-error
|
|
358
362
|
modulesByIdentifier[`$${module.identifier}`] = module;
|
|
359
363
|
}
|
|
360
364
|
}
|
|
361
365
|
}
|
|
362
366
|
}
|
|
363
|
-
const processModuleAttributes = module => {
|
|
367
|
+
const processModuleAttributes = (module) => {
|
|
364
368
|
colors.normal(" ");
|
|
365
369
|
colors.normal(SizeFormatHelpers.formatSize(module.size));
|
|
366
370
|
if (module.chunks) {
|
|
@@ -454,7 +458,7 @@ class Stats {
|
|
|
454
458
|
colors.cyan(reason.userRequest);
|
|
455
459
|
colors.normal(" ");
|
|
456
460
|
}
|
|
457
|
-
if (reason.moduleId
|
|
461
|
+
if (reason.moduleId) {
|
|
458
462
|
colors.normal("[");
|
|
459
463
|
colors.normal(reason.moduleId);
|
|
460
464
|
colors.normal("]");
|
|
@@ -503,6 +507,7 @@ class Stats {
|
|
|
503
507
|
newline();
|
|
504
508
|
}
|
|
505
509
|
if (module.modules) {
|
|
510
|
+
// @ts-expect-error
|
|
506
511
|
processModulesList(module, prefix + "| ");
|
|
507
512
|
}
|
|
508
513
|
};
|
|
@@ -654,6 +659,7 @@ class Stats {
|
|
|
654
659
|
colors.normal("[");
|
|
655
660
|
colors.normal(origin.moduleId);
|
|
656
661
|
colors.normal("] ");
|
|
662
|
+
// @ts-expect-error
|
|
657
663
|
const module = modulesByIdentifier[`$${origin.module}`];
|
|
658
664
|
if (module) {
|
|
659
665
|
colors.bold(module.name);
|
|
@@ -781,6 +787,7 @@ class Stats {
|
|
|
781
787
|
}
|
|
782
788
|
if (obj.children) {
|
|
783
789
|
for (const child of obj.children) {
|
|
790
|
+
// @ts-expect-error
|
|
784
791
|
const childString = Stats.jsonToString(child, useColors);
|
|
785
792
|
if (childString) {
|
|
786
793
|
if (child.name) {
|
|
@@ -808,9 +815,9 @@ class Stats {
|
|
|
808
815
|
}
|
|
809
816
|
}
|
|
810
817
|
exports.Stats = Stats;
|
|
811
|
-
|
|
818
|
+
_Stats_inner = new WeakMap();
|
|
812
819
|
const SizeFormatHelpers = {
|
|
813
|
-
formatSize: size => {
|
|
820
|
+
formatSize: (size) => {
|
|
814
821
|
if (typeof size !== "number" || Number.isNaN(size) === true) {
|
|
815
822
|
return "unknown size";
|
|
816
823
|
}
|