@rspack/cli 1.1.8 → 1.2.0-beta.0
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/{629.js → 574.js} +12 -53
- package/dist/{629.mjs → 574.mjs} +9 -50
- package/dist/index.js +83 -238
- package/dist/index.mjs +59 -174
- package/dist/utils/crossImport.d.ts +1 -6
- package/package.json +5 -8
package/dist/{629.js → 574.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.ids = [
|
|
3
|
-
'
|
|
3
|
+
'574'
|
|
4
4
|
];
|
|
5
5
|
exports.modules = {
|
|
6
6
|
"./src/utils/profile.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -9,47 +9,15 @@ exports.modules = {
|
|
|
9
9
|
return applyProfile;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
The full syntax, remember update this when you change something in this file.
|
|
23
|
-
|
|
24
|
-
`RSPACK_PROFILE='TRACE=filter=trace&output=./rspack.trace&layer=chrome|JSCPU=output=./rspack.jscpuprofile|LOGGING=output=./rspack.logging' rspack build`
|
|
25
|
-
^----------------------------------------------: querystring syntax trace options
|
|
26
|
-
^: | is a delimiter for different profile options
|
|
27
|
-
^---------------------------------: querystring syntax js cpuprofile options
|
|
28
|
-
^: | is a delimiter for different profile options
|
|
29
|
-
^------------------------------: querystring syntax stats.logging options
|
|
30
|
-
^-----------: trace filter, default to `trace`, more syntax: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax
|
|
31
|
-
^--------------------: trace output, `stderr`, `stdout`, or a file path, default to `./.rspack-profile-${timestamp}/trace.json` for layer `chrome` and default to `stdout` for layer `logger`
|
|
32
|
-
^-----------: trace layer, `chrome` or `logger`, default to `chrome`
|
|
33
|
-
^---------------------------: js cpuprofile output, `stderr`, `stdout`, or a file path, default to `./.rspack-profile-${timestamp}/jscpuprofile.json`
|
|
34
|
-
^----------------------: stats.logging output, default to `./.rspack-profile-${timestamp}/logging.json`
|
|
35
|
-
|
|
36
|
-
`RSPACK_PROFILE='TRACE=filter=trace&output=./rspack.trace&layer=chrome' rspack build`: only enable trace
|
|
37
|
-
|
|
38
|
-
`RSPACK_PROFILE=TRACE rspack build`: only enable trace, and use default options for trace
|
|
39
|
-
|
|
40
|
-
`RSPACK_PROFILE='JSCPU=output=./rspack.jscpuprofile' rspack build`: only enable js cpuprofile
|
|
41
|
-
|
|
42
|
-
`RSPACK_PROFILE=JSCPU rspack build`: only enable js cpuprofile, and use default options for js cpuprofile
|
|
43
|
-
|
|
44
|
-
`RSPACK_PROFILE='LOGGING=output=./rspack.logging' rspack build`: only enable stats.logging
|
|
45
|
-
|
|
46
|
-
`RSPACK_PROFILE=LOGGING rspack build`: only enable stats.logging, and use default options for stats.logging
|
|
47
|
-
|
|
48
|
-
`RSPACK_PROFILE=ALL rspack build`: enable all, and use default options
|
|
49
|
-
|
|
50
|
-
`RSPACK_PROFILE=[rspack_node,rspack_core] rspack build`: enable all, but customize trace filter
|
|
51
|
-
|
|
52
|
-
*/ function _define_property(obj, key, value) {
|
|
12
|
+
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
|
|
13
|
+
var node_fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
14
|
+
var node_inspector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:inspector");
|
|
15
|
+
var node_inspector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(node_inspector__WEBPACK_IMPORTED_MODULE_1__);
|
|
16
|
+
var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("node:path");
|
|
17
|
+
var node_path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/ __webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_2__);
|
|
18
|
+
var node_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("node:url");
|
|
19
|
+
var _rspack_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("@rspack/core");
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
53
21
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
54
22
|
value: value,
|
|
55
23
|
enumerable: true,
|
|
@@ -98,52 +66,43 @@ The full syntax, remember update this when you change something in this file.
|
|
|
98
66
|
return acc;
|
|
99
67
|
}, {});
|
|
100
68
|
}
|
|
101
|
-
// JSCPU=value
|
|
102
69
|
function resolveJSCPUProfileOptions(value) {
|
|
103
|
-
// output=filepath
|
|
104
70
|
if (value.includes("=")) {
|
|
105
71
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
106
72
|
return {
|
|
107
73
|
output: parsed.get("output") || defaultJSCPUProfileOutput
|
|
108
74
|
};
|
|
109
75
|
}
|
|
110
|
-
// filepath
|
|
111
76
|
return {
|
|
112
77
|
output: value || defaultJSCPUProfileOutput
|
|
113
78
|
};
|
|
114
79
|
}
|
|
115
|
-
// TRACE=value
|
|
116
80
|
function resolveRustTraceOptions(value) {
|
|
117
|
-
// filter=trace&output=stdout&layer=logger
|
|
118
81
|
if (value.includes("=")) {
|
|
119
82
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
120
83
|
const filter = parsed.get("filter") || defaultRustTraceFilter;
|
|
121
84
|
const layer = parsed.get("layer") || defaultRustTraceLayer;
|
|
122
85
|
const output = "chrome" === layer ? parsed.get("output") || defaultRustTraceChromeOutput : parsed.get("output") || defaultRustTraceLoggerOutput;
|
|
123
|
-
if ("chrome" !== layer && "logger" !== layer
|
|
86
|
+
if ("chrome" !== layer && "logger" !== layer) throw new Error(`${layer} is not a valid layer, should be chrome or logger`);
|
|
124
87
|
return {
|
|
125
88
|
filter,
|
|
126
89
|
layer,
|
|
127
90
|
output
|
|
128
91
|
};
|
|
129
92
|
}
|
|
130
|
-
// trace
|
|
131
93
|
return {
|
|
132
94
|
filter: value || defaultRustTraceFilter,
|
|
133
95
|
layer: defaultRustTraceLayer,
|
|
134
96
|
output: defaultRustTraceChromeOutput
|
|
135
97
|
};
|
|
136
98
|
}
|
|
137
|
-
// LOGGING=value
|
|
138
99
|
function resolveLoggingOptions(value) {
|
|
139
|
-
// output=filepath
|
|
140
100
|
if (value.includes("=")) {
|
|
141
101
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
142
102
|
return {
|
|
143
103
|
output: parsed.get("output") || defaultLoggingOutput
|
|
144
104
|
};
|
|
145
105
|
}
|
|
146
|
-
// filepath
|
|
147
106
|
return {
|
|
148
107
|
output: value || defaultLoggingOutput
|
|
149
108
|
};
|
|
@@ -190,7 +149,7 @@ The full syntax, remember update this when you change something in this file.
|
|
|
190
149
|
}
|
|
191
150
|
}
|
|
192
151
|
async function applyProfile(profileValue, item) {
|
|
193
|
-
const { default: exitHook } = await (
|
|
152
|
+
const { default: exitHook } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "exit-hook"));
|
|
194
153
|
const entries = Object.entries(resolveProfile(profileValue));
|
|
195
154
|
if (entries.length <= 0) return;
|
|
196
155
|
await node_fs__WEBPACK_IMPORTED_MODULE_0___default().promises.mkdir(defaultOutputDirname);
|
package/dist/{629.mjs → 574.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const ids = [
|
|
2
|
-
'
|
|
2
|
+
'574'
|
|
3
3
|
];
|
|
4
4
|
export const modules = {
|
|
5
5
|
"./src/utils/profile.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -8,44 +8,12 @@ export const modules = {
|
|
|
8
8
|
return applyProfile;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
The full syntax, remember update this when you change something in this file.
|
|
19
|
-
|
|
20
|
-
`RSPACK_PROFILE='TRACE=filter=trace&output=./rspack.trace&layer=chrome|JSCPU=output=./rspack.jscpuprofile|LOGGING=output=./rspack.logging' rspack build`
|
|
21
|
-
^----------------------------------------------: querystring syntax trace options
|
|
22
|
-
^: | is a delimiter for different profile options
|
|
23
|
-
^---------------------------------: querystring syntax js cpuprofile options
|
|
24
|
-
^: | is a delimiter for different profile options
|
|
25
|
-
^------------------------------: querystring syntax stats.logging options
|
|
26
|
-
^-----------: trace filter, default to `trace`, more syntax: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax
|
|
27
|
-
^--------------------: trace output, `stderr`, `stdout`, or a file path, default to `./.rspack-profile-${timestamp}/trace.json` for layer `chrome` and default to `stdout` for layer `logger`
|
|
28
|
-
^-----------: trace layer, `chrome` or `logger`, default to `chrome`
|
|
29
|
-
^---------------------------: js cpuprofile output, `stderr`, `stdout`, or a file path, default to `./.rspack-profile-${timestamp}/jscpuprofile.json`
|
|
30
|
-
^----------------------: stats.logging output, default to `./.rspack-profile-${timestamp}/logging.json`
|
|
31
|
-
|
|
32
|
-
`RSPACK_PROFILE='TRACE=filter=trace&output=./rspack.trace&layer=chrome' rspack build`: only enable trace
|
|
33
|
-
|
|
34
|
-
`RSPACK_PROFILE=TRACE rspack build`: only enable trace, and use default options for trace
|
|
35
|
-
|
|
36
|
-
`RSPACK_PROFILE='JSCPU=output=./rspack.jscpuprofile' rspack build`: only enable js cpuprofile
|
|
37
|
-
|
|
38
|
-
`RSPACK_PROFILE=JSCPU rspack build`: only enable js cpuprofile, and use default options for js cpuprofile
|
|
39
|
-
|
|
40
|
-
`RSPACK_PROFILE='LOGGING=output=./rspack.logging' rspack build`: only enable stats.logging
|
|
41
|
-
|
|
42
|
-
`RSPACK_PROFILE=LOGGING rspack build`: only enable stats.logging, and use default options for stats.logging
|
|
43
|
-
|
|
44
|
-
`RSPACK_PROFILE=ALL rspack build`: enable all, and use default options
|
|
45
|
-
|
|
46
|
-
`RSPACK_PROFILE=[rspack_node,rspack_core] rspack build`: enable all, but customize trace filter
|
|
47
|
-
|
|
48
|
-
*/ function _define_property(obj, key, value) {
|
|
11
|
+
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
|
|
12
|
+
var node_inspector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:inspector");
|
|
13
|
+
var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("node:path");
|
|
14
|
+
var node_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("node:url");
|
|
15
|
+
var _rspack_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("@rspack/core");
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
49
17
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
50
18
|
value: value,
|
|
51
19
|
enumerable: true,
|
|
@@ -94,52 +62,43 @@ The full syntax, remember update this when you change something in this file.
|
|
|
94
62
|
return acc;
|
|
95
63
|
}, {});
|
|
96
64
|
}
|
|
97
|
-
// JSCPU=value
|
|
98
65
|
function resolveJSCPUProfileOptions(value) {
|
|
99
|
-
// output=filepath
|
|
100
66
|
if (value.includes("=")) {
|
|
101
67
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
102
68
|
return {
|
|
103
69
|
output: parsed.get("output") || defaultJSCPUProfileOutput
|
|
104
70
|
};
|
|
105
71
|
}
|
|
106
|
-
// filepath
|
|
107
72
|
return {
|
|
108
73
|
output: value || defaultJSCPUProfileOutput
|
|
109
74
|
};
|
|
110
75
|
}
|
|
111
|
-
// TRACE=value
|
|
112
76
|
function resolveRustTraceOptions(value) {
|
|
113
|
-
// filter=trace&output=stdout&layer=logger
|
|
114
77
|
if (value.includes("=")) {
|
|
115
78
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
116
79
|
const filter = parsed.get("filter") || defaultRustTraceFilter;
|
|
117
80
|
const layer = parsed.get("layer") || defaultRustTraceLayer;
|
|
118
81
|
const output = "chrome" === layer ? parsed.get("output") || defaultRustTraceChromeOutput : parsed.get("output") || defaultRustTraceLoggerOutput;
|
|
119
|
-
if ("chrome" !== layer && "logger" !== layer
|
|
82
|
+
if ("chrome" !== layer && "logger" !== layer) throw new Error(`${layer} is not a valid layer, should be chrome or logger`);
|
|
120
83
|
return {
|
|
121
84
|
filter,
|
|
122
85
|
layer,
|
|
123
86
|
output
|
|
124
87
|
};
|
|
125
88
|
}
|
|
126
|
-
// trace
|
|
127
89
|
return {
|
|
128
90
|
filter: value || defaultRustTraceFilter,
|
|
129
91
|
layer: defaultRustTraceLayer,
|
|
130
92
|
output: defaultRustTraceChromeOutput
|
|
131
93
|
};
|
|
132
94
|
}
|
|
133
|
-
// LOGGING=value
|
|
134
95
|
function resolveLoggingOptions(value) {
|
|
135
|
-
// output=filepath
|
|
136
96
|
if (value.includes("=")) {
|
|
137
97
|
const parsed = new node_url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams(value);
|
|
138
98
|
return {
|
|
139
99
|
output: parsed.get("output") || defaultLoggingOutput
|
|
140
100
|
};
|
|
141
101
|
}
|
|
142
|
-
// filepath
|
|
143
102
|
return {
|
|
144
103
|
output: value || defaultLoggingOutput
|
|
145
104
|
};
|
|
@@ -186,7 +145,7 @@ The full syntax, remember update this when you change something in this file.
|
|
|
186
145
|
}
|
|
187
146
|
}
|
|
188
147
|
async function applyProfile(profileValue, item) {
|
|
189
|
-
const { default: exitHook } = await (
|
|
148
|
+
const { default: exitHook } = await import("exit-hook");
|
|
190
149
|
const entries = Object.entries(resolveProfile(profileValue));
|
|
191
150
|
if (entries.length <= 0) return;
|
|
192
151
|
await node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].promises.mkdir(defaultOutputDirname);
|