@rspack/cli 1.7.0-beta.0 → 1.7.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/bin/rspack.js +10 -10
- package/dist/0~274.js +7 -7
- package/dist/131.mjs +1262 -0
- package/dist/1~274.mjs +27 -39
- package/dist/cli.d.ts +7 -6
- package/dist/commands/build.d.ts +2 -2
- package/dist/commands/preview.d.ts +2 -2
- package/dist/commands/serve.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +106 -91
- package/dist/index.mjs +1 -1336
- package/dist/rslib-runtime.mjs +28 -0
- package/dist/types.d.ts +3 -3
- package/dist/utils/loadConfig.d.ts +2 -2
- package/dist/utils/options.d.ts +1 -1
- package/dist/utils/rspackCore.d.ts +1 -1
- package/package.json +4 -4
package/bin/rspack.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const nodeModule = require(
|
|
2
|
+
const nodeModule = require('node:module');
|
|
3
3
|
|
|
4
4
|
// enable on-disk code caching of all modules loaded by Node.js
|
|
5
5
|
// requires Nodejs >= 22.8.0
|
|
6
6
|
const { enableCompileCache } = nodeModule;
|
|
7
7
|
if (enableCompileCache) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
try {
|
|
9
|
+
enableCompileCache();
|
|
10
|
+
} catch {
|
|
11
|
+
// ignore errors
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// make it easier to identify the process via activity monitor or other tools
|
|
16
|
-
process.title =
|
|
16
|
+
process.title = 'rspack-node';
|
|
17
17
|
|
|
18
|
-
const { RspackCLI } = require(
|
|
18
|
+
const { RspackCLI } = require('../dist/index');
|
|
19
19
|
|
|
20
20
|
async function runCLI() {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const cli = new RspackCLI();
|
|
22
|
+
await cli.run(process.argv);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
runCLI();
|
package/dist/0~274.js
CHANGED
|
@@ -3,7 +3,7 @@ exports.ids = [
|
|
|
3
3
|
"274"
|
|
4
4
|
];
|
|
5
5
|
exports.modules = {
|
|
6
|
-
"./src/utils/profile.ts" (
|
|
6
|
+
"./src/utils/profile.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
applyProfile: ()=>applyProfile
|
|
9
9
|
});
|
|
@@ -12,18 +12,18 @@ exports.modules = {
|
|
|
12
12
|
var node_path__rspack_import_1 = __webpack_require__("node:path");
|
|
13
13
|
var node_path__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(node_path__rspack_import_1);
|
|
14
14
|
var _rspackCore__rspack_import_2 = __webpack_require__("./src/utils/rspackCore.ts");
|
|
15
|
-
const DEFAULT_RUST_TRACE_LAYER =
|
|
15
|
+
const DEFAULT_RUST_TRACE_LAYER = 'perfetto';
|
|
16
16
|
async function applyProfile(filterValue, traceLayer = DEFAULT_RUST_TRACE_LAYER, traceOutput) {
|
|
17
17
|
const { asyncExitHook } = await import("exit-hook");
|
|
18
|
-
if (
|
|
18
|
+
if ('logger' !== traceLayer && 'perfetto' !== traceLayer) throw new Error(`unsupported trace layer: ${traceLayer}`);
|
|
19
19
|
const timestamp = Date.now();
|
|
20
20
|
const defaultOutputDir = node_path__rspack_import_1_default().resolve(`.rspack-profile-${timestamp}-${process.pid}`);
|
|
21
21
|
if (traceOutput) {
|
|
22
|
-
if (
|
|
22
|
+
if ('stdout' !== traceOutput && 'stderr' !== traceOutput) traceOutput = node_path__rspack_import_1_default().resolve(defaultOutputDir, traceOutput);
|
|
23
23
|
} else {
|
|
24
|
-
const defaultRustTracePerfettoOutput = node_path__rspack_import_1_default().resolve(defaultOutputDir,
|
|
25
|
-
const defaultRustTraceLoggerOutput =
|
|
26
|
-
const defaultTraceOutput =
|
|
24
|
+
const defaultRustTracePerfettoOutput = node_path__rspack_import_1_default().resolve(defaultOutputDir, 'rspack.pftrace');
|
|
25
|
+
const defaultRustTraceLoggerOutput = 'stdout';
|
|
26
|
+
const defaultTraceOutput = 'perfetto' === traceLayer ? defaultRustTracePerfettoOutput : defaultRustTraceLoggerOutput;
|
|
27
27
|
traceOutput = defaultTraceOutput;
|
|
28
28
|
}
|
|
29
29
|
await ensureFileDir(traceOutput);
|