@lynx-js/rspeedy 0.12.0 → 0.12.2
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 +18 -0
- package/dist/0~src_cli_exit_ts.js +3 -3
- package/dist/0~src_config_validate_ts.js +2022 -1954
- package/dist/0~src_plugins_api_plugin_ts.js +9 -9
- package/dist/0~src_plugins_chunkLoading_plugin_ts.js +3 -3
- package/dist/0~src_plugins_dev_plugin_ts.js +3 -3
- package/dist/0~src_plugins_emitOnErrors_plugin_ts.js +3 -3
- package/dist/0~src_plugins_index_ts.js +6 -6
- package/dist/0~src_plugins_inspect_plugin_ts.js +4 -4
- package/dist/0~src_plugins_minify_plugin_ts.js +6 -6
- package/dist/0~src_plugins_optimization_plugin_ts.js +3 -3
- package/dist/0~src_plugins_output_plugin_ts.js +6 -6
- package/dist/0~src_plugins_resolve_plugin_ts.js +3 -3
- package/dist/0~src_plugins_rsdoctor_plugin_ts.js +3 -3
- package/dist/0~src_plugins_sourcemap_plugin_ts.js +3 -3
- package/dist/0~src_plugins_swc_plugin_ts.js +6 -6
- package/dist/0~src_plugins_target_plugin_ts.js +4 -4
- package/dist/0~vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js +3 -3
- package/dist/0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +8 -8
- package/dist/1~events-fs-fs_promises-os-path-stream.js +20 -20
- package/dist/1~node_child_process-node_events-node_fs-node_path.js +14 -14
- package/dist/1~src_cli_build_ts.js +28 -28
- package/dist/1~src_cli_commands_ts.js +12 -12
- package/dist/1~src_cli_dev_ts.js +24 -24
- package/dist/1~src_cli_inspect_ts.js +17 -17
- package/dist/1~src_cli_preview_ts.js +21 -21
- package/dist/1~src_config_validate_ts.js +2022 -1954
- package/dist/1~src_plugins_api_plugin_ts.js +9 -9
- package/dist/1~src_plugins_chunkLoading_plugin_ts.js +3 -3
- package/dist/1~src_plugins_dev_plugin_ts.js +3 -3
- package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +3 -3
- package/dist/1~src_plugins_index_ts.js +6 -6
- package/dist/1~src_plugins_inspect_plugin_ts.js +4 -4
- package/dist/1~src_plugins_minify_plugin_ts.js +6 -6
- package/dist/1~src_plugins_optimization_plugin_ts.js +3 -3
- package/dist/1~src_plugins_output_plugin_ts.js +6 -6
- package/dist/1~src_plugins_resolve_plugin_ts.js +3 -3
- package/dist/1~src_plugins_rsdoctor_plugin_ts.js +9 -9
- package/dist/1~src_plugins_sourcemap_plugin_ts.js +3 -3
- package/dist/1~src_plugins_swc_plugin_ts.js +6 -6
- package/dist/1~src_plugins_target_plugin_ts.js +4 -4
- package/dist/1~src_version_ts.js +4 -4
- package/dist/1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +3 -3
- package/dist/1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js +12 -12
- package/dist/1~vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js +3 -3
- package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +8 -8
- package/dist/cli/main.js +21 -21
- package/dist/cli/start.js +1 -1
- package/dist/index.js +22 -22
- package/package.json +3 -3
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
1
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
2
|
+
export const __rspack_esm_id = "src_cli_commands_ts";
|
|
3
|
+
export const __rspack_esm_ids = [
|
|
4
4
|
"src_cli_commands_ts"
|
|
5
5
|
];
|
|
6
6
|
export const __webpack_modules__ = {
|
|
7
|
-
"./src/cli/commands.ts"
|
|
7
|
+
"./src/cli/commands.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8
8
|
__webpack_require__.r(__webpack_exports__);
|
|
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);
|
|
@@ -55,7 +55,7 @@ export const __webpack_modules__ = {
|
|
|
55
55
|
return program;
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"./src/version.ts"
|
|
58
|
+
"./src/version.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
59
59
|
__webpack_require__.d(__webpack_exports__, {
|
|
60
60
|
version: ()=>version,
|
|
61
61
|
rspackVersion: ()=>rspackVersion,
|
|
@@ -63,12 +63,12 @@ export const __webpack_modules__ = {
|
|
|
63
63
|
});
|
|
64
64
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
65
65
|
var package_namespaceObject = {
|
|
66
|
-
rE: "0.12.
|
|
66
|
+
rE: "0.12.2"
|
|
67
67
|
};
|
|
68
68
|
const version = package_namespaceObject.rE;
|
|
69
69
|
const rspackVersion = core_.rspack.rspackVersion;
|
|
70
70
|
},
|
|
71
|
-
"node:path"
|
|
72
|
-
module.exports =
|
|
71
|
+
"node:path" (module) {
|
|
72
|
+
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
73
73
|
}
|
|
74
74
|
};
|
package/dist/1~src_cli_dev_ts.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
|
+
export const __rspack_esm_id = "src_cli_dev_ts";
|
|
5
|
+
export const __rspack_esm_ids = [
|
|
6
6
|
"src_cli_dev_ts"
|
|
7
7
|
];
|
|
8
8
|
export const __webpack_modules__ = {
|
|
9
|
-
"./src/cli/dev.ts"
|
|
9
|
+
"./src/cli/dev.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
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
|
},
|
|
43
|
-
"./src/cli/init.ts"
|
|
43
|
+
"./src/cli/init.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
44
44
|
__webpack_require__.d(__webpack_exports__, {
|
|
45
45
|
T: ()=>init
|
|
46
46
|
});
|
|
@@ -160,7 +160,7 @@ export const __webpack_modules__ = {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
"./src/cli/watch.ts"
|
|
163
|
+
"./src/cli/watch.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
164
164
|
__webpack_require__.d(__webpack_exports__, {
|
|
165
165
|
G: ()=>getWatchedFiles,
|
|
166
166
|
N: ()=>watchFiles
|
|
@@ -205,7 +205,7 @@ export const __webpack_modules__ = {
|
|
|
205
205
|
return watchedFiles;
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
|
-
"./src/create-rspeedy.ts"
|
|
208
|
+
"./src/create-rspeedy.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
209
209
|
__webpack_require__.d(__webpack_exports__, {
|
|
210
210
|
x: ()=>createRspeedy
|
|
211
211
|
});
|
|
@@ -406,7 +406,7 @@ export const __webpack_modules__ = {
|
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
|
-
"node:fs"
|
|
410
|
-
module.exports =
|
|
409
|
+
"node:fs" (module) {
|
|
410
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
411
411
|
}
|
|
412
412
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
|
+
export const __rspack_esm_id = "src_cli_inspect_ts";
|
|
5
|
+
export const __rspack_esm_ids = [
|
|
6
6
|
"src_cli_inspect_ts"
|
|
7
7
|
];
|
|
8
8
|
export const __webpack_modules__ = {
|
|
9
|
-
"./src/cli/init.ts"
|
|
9
|
+
"./src/cli/init.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
10
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
11
|
T: ()=>init
|
|
12
12
|
});
|
|
@@ -126,32 +126,32 @@ export const __webpack_modules__ = {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
-
"./src/cli/inspect.ts"
|
|
129
|
+
"./src/cli/inspect.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
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
|
},
|
|
154
|
-
"./src/create-rspeedy.ts"
|
|
154
|
+
"./src/create-rspeedy.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
155
155
|
__webpack_require__.d(__webpack_exports__, {
|
|
156
156
|
x: ()=>createRspeedy
|
|
157
157
|
});
|
|
@@ -352,7 +352,7 @@ export const __webpack_modules__ = {
|
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
},
|
|
355
|
-
"node:fs"
|
|
356
|
-
module.exports =
|
|
355
|
+
"node:fs" (module) {
|
|
356
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
357
357
|
}
|
|
358
358
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { register } from "#register";
|
|
3
|
-
import * as
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
3
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
|
+
export const __rspack_esm_id = "src_cli_preview_ts";
|
|
5
|
+
export const __rspack_esm_ids = [
|
|
6
6
|
"src_cli_preview_ts"
|
|
7
7
|
];
|
|
8
8
|
export const __webpack_modules__ = {
|
|
9
|
-
"./src/cli/init.ts"
|
|
9
|
+
"./src/cli/init.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
10
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
11
|
T: ()=>init
|
|
12
12
|
});
|
|
@@ -126,34 +126,34 @@ export const __webpack_modules__ = {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
-
"./src/cli/preview.ts"
|
|
129
|
+
"./src/cli/preview.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
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
|
}
|
|
155
155
|
},
|
|
156
|
-
"./src/create-rspeedy.ts"
|
|
156
|
+
"./src/create-rspeedy.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
157
157
|
__webpack_require__.d(__webpack_exports__, {
|
|
158
158
|
x: ()=>createRspeedy
|
|
159
159
|
});
|
|
@@ -354,7 +354,7 @@ export const __webpack_modules__ = {
|
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
},
|
|
357
|
-
"node:fs"
|
|
358
|
-
module.exports =
|
|
357
|
+
"node:fs" (module) {
|
|
358
|
+
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
359
359
|
}
|
|
360
360
|
};
|