@lynx-js/rspeedy-canary 0.12.0 → 0.12.1-canary-20251129-2cd5c0c8
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/CHANGELOG.md +63 -54
- package/dist/0~src_config_validate_ts.js +695 -695
- package/dist/0~src_plugins_api_plugin_ts.js +6 -6
- package/dist/0~src_plugins_index_ts.js +3 -3
- package/dist/0~src_plugins_minify_plugin_ts.js +3 -3
- package/dist/0~src_plugins_output_plugin_ts.js +2 -2
- package/dist/0~src_plugins_swc_plugin_ts.js +2 -2
- package/dist/1~events-fs-fs_promises-os-path-stream.js +12 -12
- package/dist/1~node_child_process-node_events-node_fs-node_path.js +8 -8
- package/dist/1~src_cli_build_ts.js +20 -20
- package/dist/1~src_cli_commands_ts.js +6 -6
- package/dist/1~src_cli_dev_ts.js +17 -17
- package/dist/1~src_cli_inspect_ts.js +11 -11
- package/dist/1~src_cli_preview_ts.js +15 -15
- package/dist/1~src_config_validate_ts.js +695 -695
- package/dist/1~src_plugins_api_plugin_ts.js +6 -6
- package/dist/1~src_plugins_index_ts.js +3 -3
- package/dist/1~src_plugins_minify_plugin_ts.js +3 -3
- package/dist/1~src_plugins_output_plugin_ts.js +2 -2
- package/dist/1~src_plugins_rsdoctor_plugin_ts.js +5 -5
- package/dist/1~src_plugins_swc_plugin_ts.js +2 -2
- package/dist/1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js +2 -2
- package/dist/cli/main.js +10 -10
- package/dist/index.js +10 -10
- package/package.json +2 -2
|
@@ -7,9 +7,9 @@ export const __webpack_modules__ = {
|
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
pluginAPI: ()=>pluginAPI
|
|
9
9
|
});
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var _rsbuild_core__rspack_import_0 = __webpack_require__("@rsbuild/core");
|
|
11
|
+
var _debug_js__rspack_import_1 = __webpack_require__("./src/debug.ts");
|
|
12
|
+
var _version_js__rspack_import_2 = __webpack_require__("./src/version.ts");
|
|
13
13
|
const sAPI = Symbol.for('rspeedy.api');
|
|
14
14
|
function pluginAPI(config) {
|
|
15
15
|
return {
|
|
@@ -17,13 +17,13 @@ export const __webpack_modules__ = {
|
|
|
17
17
|
setup (api) {
|
|
18
18
|
api.expose(sAPI, {
|
|
19
19
|
config,
|
|
20
|
-
debug:
|
|
20
|
+
debug: _debug_js__rspack_import_1.Yz,
|
|
21
21
|
async exit (code) {
|
|
22
22
|
const { exit } = await __webpack_require__.e("src_cli_exit_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/exit.ts"));
|
|
23
23
|
return exit(code);
|
|
24
24
|
},
|
|
25
|
-
logger:
|
|
26
|
-
version:
|
|
25
|
+
logger: _rsbuild_core__rspack_import_0.logger,
|
|
26
|
+
version: _version_js__rspack_import_2.rE
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
};
|
|
@@ -8,7 +8,7 @@ export const __webpack_modules__ = {
|
|
|
8
8
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
9
|
applyDefaultPlugins: ()=>applyDefaultPlugins
|
|
10
10
|
});
|
|
11
|
-
var
|
|
11
|
+
var _debug_js__rspack_import_0 = __webpack_require__("./src/debug.ts");
|
|
12
12
|
async function applyDebugPlugins(rsbuildInstance, config) {
|
|
13
13
|
const debugPlugins = Object.freeze([
|
|
14
14
|
__webpack_require__.e("src_plugins_emitOnErrors_plugin_ts").then(__webpack_require__.bind(__webpack_require__, "./src/plugins/emitOnErrors.plugin.ts")).then(({ pluginEmitOnErrors })=>pluginEmitOnErrors()),
|
|
@@ -38,8 +38,8 @@ export const __webpack_modules__ = {
|
|
|
38
38
|
rsbuildInstance.addPlugins(plugins);
|
|
39
39
|
})
|
|
40
40
|
];
|
|
41
|
-
if ((0,
|
|
42
|
-
(0,
|
|
41
|
+
if ((0, _debug_js__rspack_import_0._o)()) {
|
|
42
|
+
(0, _debug_js__rspack_import_0.Yz)('apply Rspeedy default debug plugins');
|
|
43
43
|
promises.push(applyDebugPlugins(rsbuildInstance, config));
|
|
44
44
|
}
|
|
45
45
|
await Promise.all(promises);
|
|
@@ -7,7 +7,7 @@ export const __webpack_modules__ = {
|
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
pluginMinify: ()=>pluginMinify
|
|
9
9
|
});
|
|
10
|
-
var
|
|
10
|
+
var _debug_js__rspack_import_0 = __webpack_require__("./src/debug.ts");
|
|
11
11
|
function pluginMinify(options) {
|
|
12
12
|
const defaultConfig = Object.freeze({
|
|
13
13
|
output: {
|
|
@@ -57,7 +57,7 @@ export const __webpack_modules__ = {
|
|
|
57
57
|
setup (api) {
|
|
58
58
|
api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
|
|
59
59
|
if (false === options) {
|
|
60
|
-
(0,
|
|
60
|
+
(0, _debug_js__rspack_import_0.Yz)("minification disabled");
|
|
61
61
|
return mergeRsbuildConfig(config, {
|
|
62
62
|
output: {
|
|
63
63
|
minify: false
|
|
@@ -69,7 +69,7 @@ export const __webpack_modules__ = {
|
|
|
69
69
|
defaultConfig
|
|
70
70
|
];
|
|
71
71
|
if (true !== options && void 0 !== options) {
|
|
72
|
-
(0,
|
|
72
|
+
(0, _debug_js__rspack_import_0.Yz)("merging minification options");
|
|
73
73
|
configs.push({
|
|
74
74
|
output: {
|
|
75
75
|
minify: options
|
|
@@ -13,12 +13,12 @@ export const __webpack_modules__ = {
|
|
|
13
13
|
__webpack_require__.d(__webpack_exports__, {
|
|
14
14
|
pluginOutput: ()=>pluginOutput
|
|
15
15
|
});
|
|
16
|
-
var
|
|
16
|
+
var _config_output_dist_path_js__rspack_import_0 = __webpack_require__("./src/config/output/dist-path.ts");
|
|
17
17
|
const defaultFilenameOptions = Object.freeze({
|
|
18
18
|
css: '[name]/[name].css'
|
|
19
19
|
});
|
|
20
20
|
const defaultDistPathOptions = Object.freeze({
|
|
21
|
-
css:
|
|
21
|
+
css: _config_output_dist_path_js__rspack_import_0.z
|
|
22
22
|
});
|
|
23
23
|
function pluginOutput(options) {
|
|
24
24
|
return {
|
|
@@ -7,7 +7,7 @@ export const __webpack_modules__ = {
|
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
pluginSwc: ()=>pluginSwc
|
|
9
9
|
});
|
|
10
|
-
var
|
|
10
|
+
var _utils_getESVersionTarget_js__rspack_import_0 = __webpack_require__("./src/utils/getESVersionTarget.ts");
|
|
11
11
|
function pluginSwc() {
|
|
12
12
|
return {
|
|
13
13
|
name: 'lynx:rsbuild:swc',
|
|
@@ -19,7 +19,7 @@ export const __webpack_modules__ = {
|
|
|
19
19
|
swc (config) {
|
|
20
20
|
delete config.env;
|
|
21
21
|
config.jsc ??= {};
|
|
22
|
-
config.jsc.target = (0,
|
|
22
|
+
config.jsc.target = (0, _utils_getESVersionTarget_js__rspack_import_0.y)(isProd);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
1
|
+
import * as __rspack_external_events from "events";
|
|
2
|
+
import * as __rspack_external_fs from "fs";
|
|
3
|
+
import * as __rspack_external_fs_promises_400951f8 from "fs/promises";
|
|
4
|
+
import * as __rspack_external_os from "os";
|
|
5
|
+
import * as __rspack_external_path from "path";
|
|
6
|
+
import * as __rspack_external_stream from "stream";
|
|
7
7
|
export const __webpack_id__ = "events-fs-fs_promises-os-path-stream";
|
|
8
8
|
export const __webpack_ids__ = [
|
|
9
9
|
"events-fs-fs_promises-os-path-stream"
|
|
10
10
|
];
|
|
11
11
|
export const __webpack_modules__ = {
|
|
12
12
|
events: function(module) {
|
|
13
|
-
module.exports =
|
|
13
|
+
module.exports = __rspack_external_events;
|
|
14
14
|
},
|
|
15
15
|
fs: function(module) {
|
|
16
|
-
module.exports =
|
|
16
|
+
module.exports = __rspack_external_fs;
|
|
17
17
|
},
|
|
18
18
|
"fs/promises": function(module) {
|
|
19
|
-
module.exports =
|
|
19
|
+
module.exports = __rspack_external_fs_promises_400951f8;
|
|
20
20
|
},
|
|
21
21
|
os: function(module) {
|
|
22
|
-
module.exports =
|
|
22
|
+
module.exports = __rspack_external_os;
|
|
23
23
|
},
|
|
24
24
|
path: function(module) {
|
|
25
|
-
module.exports =
|
|
25
|
+
module.exports = __rspack_external_path;
|
|
26
26
|
},
|
|
27
27
|
stream: function(module) {
|
|
28
|
-
module.exports =
|
|
28
|
+
module.exports = __rspack_external_stream;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
1
|
+
import * as __rspack_external_node_child_process_27f17141 from "node:child_process";
|
|
2
|
+
import * as __rspack_external_node_events_0a6aefe7 from "node:events";
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
5
5
|
export const __webpack_id__ = "node_child_process-node_events-node_fs-node_path";
|
|
6
6
|
export const __webpack_ids__ = [
|
|
7
7
|
"node_child_process-node_events-node_fs-node_path"
|
|
8
8
|
];
|
|
9
9
|
export const __webpack_modules__ = {
|
|
10
10
|
"node:child_process": function(module) {
|
|
11
|
-
module.exports =
|
|
11
|
+
module.exports = __rspack_external_node_child_process_27f17141;
|
|
12
12
|
},
|
|
13
13
|
"node:events": function(module) {
|
|
14
|
-
module.exports =
|
|
14
|
+
module.exports = __rspack_external_node_events_0a6aefe7;
|
|
15
15
|
},
|
|
16
16
|
"node:fs": function(module) {
|
|
17
|
-
module.exports =
|
|
17
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
18
18
|
},
|
|
19
19
|
"node:path": function(module) {
|
|
20
|
-
module.exports =
|
|
20
|
+
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
4
|
export const __webpack_id__ = "src_cli_build_ts";
|
|
5
5
|
export const __webpack_ids__ = [
|
|
6
6
|
"src_cli_build_ts"
|
|
@@ -10,42 +10,42 @@ export const __webpack_modules__ = {
|
|
|
10
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
11
|
build: ()=>build
|
|
12
12
|
});
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
13
|
+
var node_path__rspack_import_0 = __webpack_require__("node:path");
|
|
14
|
+
var _rsbuild_core__rspack_import_1 = __webpack_require__("@rsbuild/core");
|
|
15
|
+
var picocolors__rspack_import_7 = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
16
|
+
var picocolors__rspack_import_7_default = /*#__PURE__*/ __webpack_require__.n(picocolors__rspack_import_7);
|
|
17
|
+
var _exit_js__rspack_import_2 = __webpack_require__("./src/cli/exit.ts");
|
|
18
|
+
var _create_rspeedy_js__rspack_import_3 = __webpack_require__("./src/create-rspeedy.ts");
|
|
19
|
+
var _init_js__rspack_import_4 = __webpack_require__("./src/cli/init.ts");
|
|
20
|
+
var _watch_js__rspack_import_5 = __webpack_require__("./src/cli/watch.ts");
|
|
21
|
+
var _utils_is_ci_js__rspack_import_6 = __webpack_require__("./src/utils/is-ci.ts");
|
|
22
22
|
async function build(cwd, buildOptions) {
|
|
23
|
-
const shouldExit = 'true' !== process.env['RSDOCTOR'] || (0,
|
|
23
|
+
const shouldExit = 'true' !== process.env['RSDOCTOR'] || (0, _utils_is_ci_js__rspack_import_6.J)();
|
|
24
24
|
const isWatch = buildOptions.watch ?? false;
|
|
25
25
|
let onBeforeRestart = [];
|
|
26
26
|
try {
|
|
27
|
-
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0,
|
|
27
|
+
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__rspack_import_4.T)(cwd, buildOptions);
|
|
28
28
|
if (isWatch) {
|
|
29
|
-
const watchedFiles = (0,
|
|
30
|
-
await (0,
|
|
31
|
-
|
|
29
|
+
const watchedFiles = (0, _watch_js__rspack_import_5.G)(configPath, rspeedyConfig);
|
|
30
|
+
await (0, _watch_js__rspack_import_5.N)(watchedFiles.map((filePath)=>node_path__rspack_import_0["default"].isAbsolute(filePath) ? filePath : node_path__rspack_import_0["default"].join(cwd, filePath)), async (filename)=>{
|
|
31
|
+
_rsbuild_core__rspack_import_1.logger.info(`Restart because ${picocolors__rspack_import_7_default().yellow(filename)} is changed.\n`);
|
|
32
32
|
const cleanup = onBeforeRestart.map((f)=>f());
|
|
33
33
|
onBeforeRestart = [];
|
|
34
34
|
await Promise.all(cleanup);
|
|
35
35
|
await build.call(this, cwd, buildOptions);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
const rspeedy = await (0,
|
|
38
|
+
const rspeedy = await (0, _create_rspeedy_js__rspack_import_3.x)(createRspeedyOptions);
|
|
39
39
|
const { close } = await rspeedy.build({
|
|
40
40
|
watch: isWatch
|
|
41
41
|
});
|
|
42
42
|
if (isWatch) onBeforeRestart.push(close);
|
|
43
43
|
else await close();
|
|
44
44
|
} catch (error) {
|
|
45
|
-
|
|
46
|
-
if (shouldExit) return void (0,
|
|
45
|
+
_rsbuild_core__rspack_import_1.logger.error(error);
|
|
46
|
+
if (shouldExit) return void (0, _exit_js__rspack_import_2.exit)(1);
|
|
47
47
|
}
|
|
48
|
-
if (shouldExit && !isWatch) (0,
|
|
48
|
+
if (shouldExit && !isWatch) (0, _exit_js__rspack_import_2.exit)();
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -423,6 +423,6 @@ export const __webpack_modules__ = {
|
|
|
423
423
|
}
|
|
424
424
|
},
|
|
425
425
|
"node:fs": function(module) {
|
|
426
|
-
module.exports =
|
|
426
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
2
2
|
export const __webpack_id__ = "src_cli_commands_ts";
|
|
3
3
|
export const __webpack_ids__ = [
|
|
4
4
|
"src_cli_commands_ts"
|
|
@@ -9,18 +9,18 @@ export const __webpack_modules__ = {
|
|
|
9
9
|
__webpack_require__.d(__webpack_exports__, {
|
|
10
10
|
apply: ()=>apply
|
|
11
11
|
});
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var node_path__rspack_import_0 = __webpack_require__("node:path");
|
|
13
|
+
var _version_js__rspack_import_1 = __webpack_require__("./src/version.ts");
|
|
14
14
|
function applyCommonOptions(command) {
|
|
15
15
|
command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--env-mode <mode>', 'specify the env mode to load the .env.[mode] file').option('--no-env', 'disable loading `.env` files"').option('-m --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('-r --root <root>', 'set the project root directory (absolute path or relative to cwd)');
|
|
16
16
|
}
|
|
17
17
|
function resolveRoot(cwd, root) {
|
|
18
18
|
if (!root) return cwd;
|
|
19
|
-
return
|
|
19
|
+
return node_path__rspack_import_0["default"].isAbsolute(root) ? root : node_path__rspack_import_0["default"].resolve(cwd, root);
|
|
20
20
|
}
|
|
21
21
|
function apply(program) {
|
|
22
22
|
const cwd = process.cwd();
|
|
23
|
-
program.name('rspeedy').usage('<command> [options]').version(
|
|
23
|
+
program.name('rspeedy').usage('<command> [options]').version(_version_js__rspack_import_1.version).option('--unmanaged', 'Force to use the unmanaged version of Rspeedy, instead of the locally installed.').showHelpAfterError(true).showSuggestionAfterError(true).exitOverride();
|
|
24
24
|
const buildCommand = program.command('build');
|
|
25
25
|
buildCommand.description('Build the project in production mode').option('--environment <name...>', 'specify the name of environment to build').option('--watch', 'Enable watch mode to automatically rebuild on file changes').action(async (buildOptions)=>{
|
|
26
26
|
const actualRoot = resolveRoot(cwd, buildOptions.root);
|
|
@@ -69,6 +69,6 @@ export const __webpack_modules__ = {
|
|
|
69
69
|
const rspackVersion = core_.rspack.rspackVersion;
|
|
70
70
|
},
|
|
71
71
|
"node:path": function(module) {
|
|
72
|
-
module.exports =
|
|
72
|
+
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
73
73
|
}
|
|
74
74
|
};
|
package/dist/1~src_cli_dev_ts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
4
|
export const __webpack_id__ = "src_cli_dev_ts";
|
|
5
5
|
export const __webpack_ids__ = [
|
|
6
6
|
"src_cli_dev_ts"
|
|
@@ -10,33 +10,33 @@ export const __webpack_modules__ = {
|
|
|
10
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
11
|
dev: ()=>dev
|
|
12
12
|
});
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
13
|
+
var node_path__rspack_import_0 = __webpack_require__("node:path");
|
|
14
|
+
var _rsbuild_core__rspack_import_1 = __webpack_require__("@rsbuild/core");
|
|
15
|
+
var picocolors__rspack_import_6 = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
16
|
+
var picocolors__rspack_import_6_default = /*#__PURE__*/ __webpack_require__.n(picocolors__rspack_import_6);
|
|
17
|
+
var _create_rspeedy_js__rspack_import_2 = __webpack_require__("./src/create-rspeedy.ts");
|
|
18
|
+
var _exit_js__rspack_import_3 = __webpack_require__("./src/cli/exit.ts");
|
|
19
|
+
var _init_js__rspack_import_4 = __webpack_require__("./src/cli/init.ts");
|
|
20
|
+
var _watch_js__rspack_import_5 = __webpack_require__("./src/cli/watch.ts");
|
|
21
21
|
async function dev(cwd, devOptions) {
|
|
22
22
|
let onBeforeRestart = [];
|
|
23
23
|
try {
|
|
24
|
-
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0,
|
|
25
|
-
const watchedFiles = (0,
|
|
26
|
-
await (0,
|
|
27
|
-
|
|
24
|
+
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__rspack_import_4.T)(cwd, devOptions);
|
|
25
|
+
const watchedFiles = (0, _watch_js__rspack_import_5.G)(configPath, rspeedyConfig);
|
|
26
|
+
await (0, _watch_js__rspack_import_5.N)(watchedFiles.map((filePath)=>node_path__rspack_import_0["default"].isAbsolute(filePath) ? filePath : node_path__rspack_import_0["default"].join(cwd, filePath)), async (filename)=>{
|
|
27
|
+
_rsbuild_core__rspack_import_1.logger.info(`Restart because ${picocolors__rspack_import_6_default().yellow(filename)} is changed.\n`);
|
|
28
28
|
const cleanup = onBeforeRestart.map((f)=>f());
|
|
29
29
|
onBeforeRestart = [];
|
|
30
30
|
await Promise.all(cleanup);
|
|
31
31
|
await dev.call(this, cwd, devOptions);
|
|
32
32
|
});
|
|
33
|
-
const rspeedy = await (0,
|
|
33
|
+
const rspeedy = await (0, _create_rspeedy_js__rspack_import_2.x)(createRspeedyOptions);
|
|
34
34
|
const server = await rspeedy.createDevServer();
|
|
35
35
|
const { server: { close } } = await server.listen();
|
|
36
36
|
onBeforeRestart.push(close);
|
|
37
37
|
} catch (error) {
|
|
38
|
-
|
|
39
|
-
(0,
|
|
38
|
+
_rsbuild_core__rspack_import_1.logger.error(error);
|
|
39
|
+
(0, _exit_js__rspack_import_3.exit)(1);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
},
|
|
@@ -407,6 +407,6 @@ export const __webpack_modules__ = {
|
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
409
|
"node:fs": function(module) {
|
|
410
|
-
module.exports =
|
|
410
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
411
411
|
}
|
|
412
412
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
4
|
export const __webpack_id__ = "src_cli_inspect_ts";
|
|
5
5
|
export const __webpack_ids__ = [
|
|
6
6
|
"src_cli_inspect_ts"
|
|
@@ -130,24 +130,24 @@ export const __webpack_modules__ = {
|
|
|
130
130
|
__webpack_require__.d(__webpack_exports__, {
|
|
131
131
|
inspect: ()=>inspect
|
|
132
132
|
});
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
133
|
+
var _rsbuild_core__rspack_import_0 = __webpack_require__("@rsbuild/core");
|
|
134
|
+
var _exit_js__rspack_import_1 = __webpack_require__("./src/cli/exit.ts");
|
|
135
|
+
var _create_rspeedy_js__rspack_import_2 = __webpack_require__("./src/create-rspeedy.ts");
|
|
136
|
+
var _init_js__rspack_import_3 = __webpack_require__("./src/cli/init.ts");
|
|
137
137
|
async function inspect(cwd, inspectOptions) {
|
|
138
138
|
try {
|
|
139
|
-
const { createRspeedyOptions } = await (0,
|
|
140
|
-
const rspeedy = await (0,
|
|
139
|
+
const { createRspeedyOptions } = await (0, _init_js__rspack_import_3.T)(cwd, inspectOptions);
|
|
140
|
+
const rspeedy = await (0, _create_rspeedy_js__rspack_import_2.x)(createRspeedyOptions);
|
|
141
141
|
await rspeedy.inspectConfig({
|
|
142
142
|
mode: inspectOptions.mode ?? rspeedy.getRspeedyConfig().mode ?? 'development',
|
|
143
143
|
verbose: inspectOptions.verbose ?? false,
|
|
144
144
|
outputPath: inspectOptions.output,
|
|
145
145
|
writeToDisk: true
|
|
146
146
|
});
|
|
147
|
-
return (0,
|
|
147
|
+
return (0, _exit_js__rspack_import_1.exit)();
|
|
148
148
|
} catch (error) {
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
_rsbuild_core__rspack_import_0.logger.error(error);
|
|
150
|
+
_rsbuild_core__rspack_import_0.logger.error();
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
},
|
|
@@ -353,6 +353,6 @@ export const __webpack_modules__ = {
|
|
|
353
353
|
}
|
|
354
354
|
},
|
|
355
355
|
"node:fs": function(module) {
|
|
356
|
-
module.exports =
|
|
356
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
357
357
|
}
|
|
358
358
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
4
|
export const __webpack_id__ = "src_cli_preview_ts";
|
|
5
5
|
export const __webpack_ids__ = [
|
|
6
6
|
"src_cli_preview_ts"
|
|
@@ -130,25 +130,25 @@ export const __webpack_modules__ = {
|
|
|
130
130
|
__webpack_require__.d(__webpack_exports__, {
|
|
131
131
|
preview: ()=>preview
|
|
132
132
|
});
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
var
|
|
139
|
-
var
|
|
133
|
+
var node_fs__rspack_import_0 = __webpack_require__("node:fs");
|
|
134
|
+
var _rsbuild_core__rspack_import_1 = __webpack_require__("@rsbuild/core");
|
|
135
|
+
var picocolors__rspack_import_5 = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
136
|
+
var picocolors__rspack_import_5_default = /*#__PURE__*/ __webpack_require__.n(picocolors__rspack_import_5);
|
|
137
|
+
var _exit_js__rspack_import_2 = __webpack_require__("./src/cli/exit.ts");
|
|
138
|
+
var _create_rspeedy_js__rspack_import_3 = __webpack_require__("./src/create-rspeedy.ts");
|
|
139
|
+
var _init_js__rspack_import_4 = __webpack_require__("./src/cli/init.ts");
|
|
140
140
|
async function preview(cwd, previewOptions) {
|
|
141
141
|
try {
|
|
142
|
-
const { createRspeedyOptions } = await (0,
|
|
143
|
-
const rspeedy = await (0,
|
|
142
|
+
const { createRspeedyOptions } = await (0, _init_js__rspack_import_4.T)(cwd, previewOptions);
|
|
143
|
+
const rspeedy = await (0, _create_rspeedy_js__rspack_import_3.x)(createRspeedyOptions);
|
|
144
144
|
await rspeedy.initConfigs();
|
|
145
145
|
const { distPath } = rspeedy.context;
|
|
146
|
-
if (!
|
|
146
|
+
if (!node_fs__rspack_import_0["default"].existsSync(distPath)) throw new Error(`The output directory ${picocolors__rspack_import_5_default().yellow(distPath)} does not exist, please build the project before previewing.`);
|
|
147
147
|
await rspeedy.preview();
|
|
148
148
|
} catch (error) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
(0,
|
|
149
|
+
_rsbuild_core__rspack_import_1.logger.error('Failed to start preview server.');
|
|
150
|
+
_rsbuild_core__rspack_import_1.logger.error(error);
|
|
151
|
+
(0, _exit_js__rspack_import_2.exit)(1);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -355,6 +355,6 @@ export const __webpack_modules__ = {
|
|
|
355
355
|
}
|
|
356
356
|
},
|
|
357
357
|
"node:fs": function(module) {
|
|
358
|
-
module.exports =
|
|
358
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
359
359
|
}
|
|
360
360
|
};
|