@rspack/cli 1.6.5 → 1.6.7
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/0~274.js +13 -13
- package/dist/1~274.mjs +13 -13
- package/dist/index.js +10 -10
- package/dist/index.mjs +30 -30
- package/package.json +4 -4
package/dist/0~274.js
CHANGED
|
@@ -3,38 +3,38 @@ exports.ids = [
|
|
|
3
3
|
"274"
|
|
4
4
|
];
|
|
5
5
|
exports.modules = {
|
|
6
|
-
"./src/utils/profile.ts"
|
|
6
|
+
"./src/utils/profile.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
applyProfile: ()=>applyProfile
|
|
9
9
|
});
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var node_fs__rspack_import_0 = __webpack_require__("node:fs");
|
|
11
|
+
var node_fs__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(node_fs__rspack_import_0);
|
|
12
|
+
var node_path__rspack_import_1 = __webpack_require__("node:path");
|
|
13
|
+
var node_path__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(node_path__rspack_import_1);
|
|
14
|
+
var _rspackCore__rspack_import_2 = __webpack_require__("./src/utils/rspackCore.ts");
|
|
15
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
18
|
if ("logger" !== traceLayer && "perfetto" !== traceLayer) throw new Error(`unsupported trace layer: ${traceLayer}`);
|
|
19
19
|
const timestamp = Date.now();
|
|
20
|
-
const defaultOutputDir =
|
|
20
|
+
const defaultOutputDir = node_path__rspack_import_1_default().resolve(`.rspack-profile-${timestamp}-${process.pid}`);
|
|
21
21
|
if (traceOutput) {
|
|
22
|
-
if ("stdout" !== traceOutput && "stderr" !== traceOutput) traceOutput =
|
|
22
|
+
if ("stdout" !== traceOutput && "stderr" !== traceOutput) traceOutput = node_path__rspack_import_1_default().resolve(defaultOutputDir, traceOutput);
|
|
23
23
|
} else {
|
|
24
|
-
const defaultRustTracePerfettoOutput =
|
|
24
|
+
const defaultRustTracePerfettoOutput = node_path__rspack_import_1_default().resolve(defaultOutputDir, "rspack.pftrace");
|
|
25
25
|
const defaultRustTraceLoggerOutput = "stdout";
|
|
26
26
|
const defaultTraceOutput = "perfetto" === traceLayer ? defaultRustTracePerfettoOutput : defaultRustTraceLoggerOutput;
|
|
27
27
|
traceOutput = defaultTraceOutput;
|
|
28
28
|
}
|
|
29
29
|
await ensureFileDir(traceOutput);
|
|
30
|
-
await
|
|
31
|
-
asyncExitHook(
|
|
30
|
+
await _rspackCore__rspack_import_2.Z.experiments.globalTrace.register(filterValue, traceLayer, traceOutput);
|
|
31
|
+
asyncExitHook(_rspackCore__rspack_import_2.Z.experiments.globalTrace.cleanup, {
|
|
32
32
|
wait: 500
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
async function ensureFileDir(outputFilePath) {
|
|
36
|
-
const dir =
|
|
37
|
-
await
|
|
36
|
+
const dir = node_path__rspack_import_1_default().dirname(outputFilePath);
|
|
37
|
+
await node_fs__rspack_import_0_default().promises.mkdir(dir, {
|
|
38
38
|
recursive: true
|
|
39
39
|
});
|
|
40
40
|
}
|
package/dist/1~274.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
1
|
+
export const __rspack_esm_id = "274";
|
|
2
|
+
export const __rspack_esm_ids = [
|
|
3
3
|
"274"
|
|
4
4
|
];
|
|
5
5
|
export const __webpack_modules__ = {
|
|
6
|
-
"./src/utils/profile.ts"
|
|
6
|
+
"./src/utils/profile.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
applyProfile: ()=>applyProfile
|
|
9
9
|
});
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var node_fs__rspack_import_0 = __webpack_require__("node:fs");
|
|
11
|
+
var node_path__rspack_import_1 = __webpack_require__("node:path");
|
|
12
|
+
var _rspackCore__rspack_import_2 = __webpack_require__("./src/utils/rspackCore.ts");
|
|
13
13
|
const DEFAULT_RUST_TRACE_LAYER = "perfetto";
|
|
14
14
|
async function applyProfile(filterValue, traceLayer = DEFAULT_RUST_TRACE_LAYER, traceOutput) {
|
|
15
15
|
const { asyncExitHook } = await import("exit-hook");
|
|
16
16
|
if ("logger" !== traceLayer && "perfetto" !== traceLayer) throw new Error(`unsupported trace layer: ${traceLayer}`);
|
|
17
17
|
const timestamp = Date.now();
|
|
18
|
-
const defaultOutputDir =
|
|
18
|
+
const defaultOutputDir = node_path__rspack_import_1["default"].resolve(`.rspack-profile-${timestamp}-${process.pid}`);
|
|
19
19
|
if (traceOutput) {
|
|
20
|
-
if ("stdout" !== traceOutput && "stderr" !== traceOutput) traceOutput =
|
|
20
|
+
if ("stdout" !== traceOutput && "stderr" !== traceOutput) traceOutput = node_path__rspack_import_1["default"].resolve(defaultOutputDir, traceOutput);
|
|
21
21
|
} else {
|
|
22
|
-
const defaultRustTracePerfettoOutput =
|
|
22
|
+
const defaultRustTracePerfettoOutput = node_path__rspack_import_1["default"].resolve(defaultOutputDir, "rspack.pftrace");
|
|
23
23
|
const defaultRustTraceLoggerOutput = "stdout";
|
|
24
24
|
const defaultTraceOutput = "perfetto" === traceLayer ? defaultRustTracePerfettoOutput : defaultRustTraceLoggerOutput;
|
|
25
25
|
traceOutput = defaultTraceOutput;
|
|
26
26
|
}
|
|
27
27
|
await ensureFileDir(traceOutput);
|
|
28
|
-
await
|
|
29
|
-
asyncExitHook(
|
|
28
|
+
await _rspackCore__rspack_import_2.Z.experiments.globalTrace.register(filterValue, traceLayer, traceOutput);
|
|
29
|
+
asyncExitHook(_rspackCore__rspack_import_2.Z.experiments.globalTrace.cleanup, {
|
|
30
30
|
wait: 500
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
async function ensureFileDir(outputFilePath) {
|
|
34
|
-
const dir =
|
|
35
|
-
await
|
|
34
|
+
const dir = node_path__rspack_import_1["default"].dirname(outputFilePath);
|
|
35
|
+
await node_fs__rspack_import_0["default"].promises.mkdir(dir, {
|
|
36
36
|
recursive: true
|
|
37
37
|
});
|
|
38
38
|
}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
|
2
2
|
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
3
|
}();
|
|
4
4
|
var __webpack_modules__ = {
|
|
5
|
-
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"
|
|
5
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
6
6
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
7
7
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
8
8
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
@@ -68,7 +68,7 @@ var __webpack_modules__ = {
|
|
|
68
68
|
module.exports = createColors();
|
|
69
69
|
module.exports.createColors = createColors;
|
|
70
70
|
},
|
|
71
|
-
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js"
|
|
71
|
+
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js" (module, exports1, __webpack_require__) {
|
|
72
72
|
"use strict";
|
|
73
73
|
module = __webpack_require__.nmd(module);
|
|
74
74
|
const BuiltinModule = __webpack_require__("module");
|
|
@@ -129,7 +129,7 @@ var __webpack_modules__ = {
|
|
|
129
129
|
}
|
|
130
130
|
exports1.addHook = addHook;
|
|
131
131
|
},
|
|
132
|
-
"./src/utils/rspackCore.ts"
|
|
132
|
+
"./src/utils/rspackCore.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
133
133
|
"use strict";
|
|
134
134
|
__webpack_require__.d(__webpack_exports__, {
|
|
135
135
|
Z: ()=>rspack
|
|
@@ -138,19 +138,19 @@ var __webpack_modules__ = {
|
|
|
138
138
|
const rspackCore_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
139
139
|
const rspack = rspackCore_require("@rspack/core");
|
|
140
140
|
},
|
|
141
|
-
module
|
|
141
|
+
module (module) {
|
|
142
142
|
"use strict";
|
|
143
143
|
module.exports = require("module");
|
|
144
144
|
},
|
|
145
|
-
"node:fs"
|
|
145
|
+
"node:fs" (module) {
|
|
146
146
|
"use strict";
|
|
147
147
|
module.exports = require("node:fs");
|
|
148
148
|
},
|
|
149
|
-
"node:path"
|
|
149
|
+
"node:path" (module) {
|
|
150
150
|
"use strict";
|
|
151
151
|
module.exports = require("node:path");
|
|
152
152
|
},
|
|
153
|
-
path
|
|
153
|
+
path (module) {
|
|
154
154
|
"use strict";
|
|
155
155
|
module.exports = require("path");
|
|
156
156
|
}
|
|
@@ -1187,7 +1187,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
1187
1187
|
this.colors = this.createColors();
|
|
1188
1188
|
this.program = program;
|
|
1189
1189
|
program.help();
|
|
1190
|
-
program.version("1.6.
|
|
1190
|
+
program.version("1.6.7");
|
|
1191
1191
|
}
|
|
1192
1192
|
async createCompiler(options, rspackCommand, callback) {
|
|
1193
1193
|
let { config, pathMap } = await this.loadConfig(options);
|
|
@@ -1350,11 +1350,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
1350
1350
|
exports.RspackCLI = __webpack_exports__.RspackCLI;
|
|
1351
1351
|
exports.defineConfig = __webpack_exports__.defineConfig;
|
|
1352
1352
|
exports.definePlugin = __webpack_exports__.definePlugin;
|
|
1353
|
-
for(var
|
|
1353
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
1354
1354
|
"RspackCLI",
|
|
1355
1355
|
"defineConfig",
|
|
1356
1356
|
"definePlugin"
|
|
1357
|
-
].indexOf(
|
|
1357
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
1358
1358
|
Object.defineProperty(exports, '__esModule', {
|
|
1359
1359
|
value: true
|
|
1360
1360
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
1
|
+
import * as __rspack_external_module from "module";
|
|
2
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
3
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
4
|
+
import * as __rspack_external_path from "path";
|
|
5
|
+
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
6
|
+
import * as __rspack_external_events from "events";
|
|
7
|
+
import * as __rspack_external_node_module_ab9f2194 from "node:module";
|
|
8
|
+
import * as __rspack_external_node_url_e96de089 from "node:url";
|
|
9
9
|
var __webpack_modules__ = {
|
|
10
|
-
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"
|
|
10
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
11
11
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
12
12
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
13
13
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
@@ -73,7 +73,7 @@ var __webpack_modules__ = {
|
|
|
73
73
|
module.exports = createColors();
|
|
74
74
|
module.exports.createColors = createColors;
|
|
75
75
|
},
|
|
76
|
-
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js"
|
|
76
|
+
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js" (module, exports, __webpack_require__) {
|
|
77
77
|
module = __webpack_require__.nmd(module);
|
|
78
78
|
const BuiltinModule = __webpack_require__("module");
|
|
79
79
|
const path = __webpack_require__("path");
|
|
@@ -133,24 +133,24 @@ var __webpack_modules__ = {
|
|
|
133
133
|
}
|
|
134
134
|
exports.addHook = addHook;
|
|
135
135
|
},
|
|
136
|
-
"./src/utils/rspackCore.ts"
|
|
136
|
+
"./src/utils/rspackCore.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
137
137
|
__webpack_require__.d(__webpack_exports__, {
|
|
138
138
|
Z: ()=>rspack
|
|
139
139
|
});
|
|
140
|
-
const rspackCore_require = (0,
|
|
140
|
+
const rspackCore_require = (0, __rspack_external_node_module_ab9f2194.createRequire)(import.meta.url);
|
|
141
141
|
const rspack = rspackCore_require("@rspack/core");
|
|
142
142
|
},
|
|
143
|
-
module
|
|
144
|
-
module.exports =
|
|
143
|
+
module (module) {
|
|
144
|
+
module.exports = __rspack_external_module;
|
|
145
145
|
},
|
|
146
|
-
"node:fs"
|
|
147
|
-
module.exports =
|
|
146
|
+
"node:fs" (module) {
|
|
147
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
148
148
|
},
|
|
149
|
-
"node:path"
|
|
150
|
-
module.exports =
|
|
149
|
+
"node:path" (module) {
|
|
150
|
+
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
151
151
|
},
|
|
152
|
-
path
|
|
153
|
-
module.exports =
|
|
152
|
+
path (module) {
|
|
153
|
+
module.exports = __rspack_external_path;
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
var __webpack_module_cache__ = {};
|
|
@@ -200,16 +200,16 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
200
200
|
410: 0
|
|
201
201
|
};
|
|
202
202
|
var installChunk = (data)=>{
|
|
203
|
-
var
|
|
203
|
+
var __rspack_esm_ids = data.__rspack_esm_ids;
|
|
204
204
|
var __webpack_modules__ = data.__webpack_modules__;
|
|
205
|
-
var
|
|
205
|
+
var __rspack_esm_runtime = data.__rspack_esm_runtime;
|
|
206
206
|
var moduleId, chunkId, i = 0;
|
|
207
207
|
for(moduleId in __webpack_modules__)if (__webpack_require__.o(__webpack_modules__, moduleId)) __webpack_require__.m[moduleId] = __webpack_modules__[moduleId];
|
|
208
|
-
if (
|
|
209
|
-
for(; i <
|
|
210
|
-
chunkId =
|
|
208
|
+
if (__rspack_esm_runtime) __rspack_esm_runtime(__webpack_require__);
|
|
209
|
+
for(; i < __rspack_esm_ids.length; i++){
|
|
210
|
+
chunkId = __rspack_esm_ids[i];
|
|
211
211
|
if (__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) installedChunks[chunkId][0]();
|
|
212
|
-
installedChunks[
|
|
212
|
+
installedChunks[__rspack_esm_ids[i]] = 0;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
__webpack_require__.f.j = function(chunkId, promises) {
|
|
@@ -553,7 +553,7 @@ class GlobalCommand extends Command {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
var __assign = Object.assign;
|
|
556
|
-
class CAC extends
|
|
556
|
+
class CAC extends __rspack_external_events.EventEmitter {
|
|
557
557
|
constructor(name = ""){
|
|
558
558
|
super();
|
|
559
559
|
this.name = name;
|
|
@@ -1014,7 +1014,7 @@ const isEsmFile = (filePath)=>{
|
|
|
1014
1014
|
};
|
|
1015
1015
|
const crossImport = async (path)=>{
|
|
1016
1016
|
if (isEsmFile(path)) {
|
|
1017
|
-
const url = (0,
|
|
1017
|
+
const url = (0, __rspack_external_node_url_e96de089.pathToFileURL)(path).href;
|
|
1018
1018
|
const { default: config } = await import(url);
|
|
1019
1019
|
return config;
|
|
1020
1020
|
}
|
|
@@ -1174,7 +1174,7 @@ class RspackCLI {
|
|
|
1174
1174
|
this.colors = this.createColors();
|
|
1175
1175
|
this.program = program;
|
|
1176
1176
|
program.help();
|
|
1177
|
-
program.version("1.6.
|
|
1177
|
+
program.version("1.6.7");
|
|
1178
1178
|
}
|
|
1179
1179
|
async createCompiler(options, rspackCommand, callback) {
|
|
1180
1180
|
let { config, pathMap } = await this.loadConfig(options);
|
|
@@ -1206,7 +1206,7 @@ class RspackCLI {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
getLogger() {
|
|
1208
1208
|
return {
|
|
1209
|
-
error: (val)=>console.error(`[rspack-cli] ${this.colors.red(
|
|
1209
|
+
error: (val)=>console.error(`[rspack-cli] ${this.colors.red(__rspack_external_node_util_1b29d436["default"].format(val))}`),
|
|
1210
1210
|
warn: (val)=>console.warn(`[rspack-cli] ${this.colors.yellow(val)}`),
|
|
1211
1211
|
info: (val)=>console.info(`[rspack-cli] ${this.colors.cyan(val)}`),
|
|
1212
1212
|
success: (val)=>console.log(`[rspack-cli] ${this.colors.green(val)}`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "CLI for rspack",
|
|
5
5
|
"homepage": "https://rspack.rs",
|
|
6
6
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"webpack-bundle-analyzer": "4.10.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@rslib/core": "0.18.
|
|
37
|
+
"@rslib/core": "0.18.3",
|
|
38
38
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
39
39
|
"cac": "^6.7.14",
|
|
40
40
|
"concat-stream": "^2.0.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"pirates": "^4.0.7",
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"@rspack/core": "1.6.
|
|
48
|
-
"@rspack/test-tools": "1.6.
|
|
47
|
+
"@rspack/core": "1.6.7",
|
|
48
|
+
"@rspack/test-tools": "1.6.7"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@rspack/core": "^1.0.0-alpha || ^1.x"
|