@lynx-js/rspeedy-canary 0.10.9-canary-20250826-d65ef500 → 0.11.0-canary-20250826-48c8fc40
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 +9 -1
- package/dist/cli/main.js +12 -73
- package/dist/events-fs-fs_promises-os-path-stream.js +30 -0
- package/dist/index.js +19 -39
- package/dist/node_child_process-node_events-node_fs-node_path.js +22 -0
- package/dist/src_cli_build_ts.js +35 -23
- package/dist/src_cli_commands_ts.js +3 -2
- package/dist/src_cli_dev_ts.js +33 -21
- package/dist/src_cli_exit_ts.js +12 -11
- package/dist/src_cli_inspect_ts.js +25 -16
- package/dist/src_cli_preview_ts.js +25 -16
- package/dist/src_config_validate_ts.js +105 -65
- package/dist/src_plugins_api_plugin_ts.js +4 -3
- package/dist/src_plugins_chunkLoading_plugin_ts.js +6 -5
- package/dist/src_plugins_dev_plugin_ts.js +4 -3
- package/dist/src_plugins_emitOnErrors_plugin_ts.js +1 -0
- package/dist/src_plugins_index_ts.js +3 -2
- package/dist/src_plugins_inspect_plugin_ts.js +16 -15
- package/dist/src_plugins_minify_plugin_ts.js +3 -2
- package/dist/src_plugins_optimization_plugin_ts.js +1 -0
- package/dist/src_plugins_output_plugin_ts.js +3 -2
- package/dist/src_plugins_resolve_plugin_ts.js +1 -0
- package/dist/src_plugins_rsdoctor_plugin_ts.js +8 -13
- package/dist/src_plugins_sourcemap_plugin_ts.js +1 -0
- package/dist/src_plugins_swc_plugin_ts.js +3 -2
- package/dist/src_plugins_target_plugin_ts.js +6 -5
- package/dist/src_version_ts.js +3 -2
- package/dist/vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +1 -0
- package/dist/vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js +1 -0
- package/dist/vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js +1 -0
- package/dist/vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +1 -0
- package/package.json +3 -3
package/dist/src_cli_dev_ts.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { register } from "@lynx-js/rspeedy/register";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
5
|
+
export const __webpack_id__ = "src_cli_dev_ts";
|
|
1
6
|
export const __webpack_ids__ = [
|
|
2
7
|
"src_cli_dev_ts"
|
|
3
8
|
];
|
|
@@ -18,16 +23,16 @@ export const __webpack_modules__ = {
|
|
|
18
23
|
async function dev(cwd, devOptions) {
|
|
19
24
|
let onBeforeRestart = [];
|
|
20
25
|
try {
|
|
21
|
-
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.
|
|
22
|
-
const watchedFiles = (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.
|
|
23
|
-
await (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.
|
|
26
|
+
const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.T)(cwd, devOptions);
|
|
27
|
+
const watchedFiles = (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.G)(configPath, rspeedyConfig);
|
|
28
|
+
await (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.N)(watchedFiles.map((filePath)=>node_path__WEBPACK_IMPORTED_MODULE_0__["default"].isAbsolute(filePath) ? filePath : node_path__WEBPACK_IMPORTED_MODULE_0__["default"].join(cwd, filePath)), async (filename)=>{
|
|
24
29
|
_rsbuild_core__WEBPACK_IMPORTED_MODULE_1__.logger.info(`Restart because ${picocolors__WEBPACK_IMPORTED_MODULE_6___default().yellow(filename)} is changed.\n`);
|
|
25
30
|
const cleanup = onBeforeRestart.map((f)=>f());
|
|
26
31
|
onBeforeRestart = [];
|
|
27
32
|
await Promise.all(cleanup);
|
|
28
33
|
await dev.call(this, cwd, devOptions);
|
|
29
34
|
});
|
|
30
|
-
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__.
|
|
35
|
+
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__.x)(createRspeedyOptions);
|
|
31
36
|
const server = await rspeedy.createDevServer();
|
|
32
37
|
const { server: { close } } = await server.listen();
|
|
33
38
|
onBeforeRestart.push(close);
|
|
@@ -39,18 +44,16 @@ export const __webpack_modules__ = {
|
|
|
39
44
|
},
|
|
40
45
|
"./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41
46
|
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
-
|
|
47
|
+
T: ()=>init
|
|
43
48
|
});
|
|
44
49
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
45
50
|
var external_node_path_ = __webpack_require__("node:path");
|
|
46
|
-
var external_node_url_ = __webpack_require__("node:url");
|
|
47
51
|
var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
48
52
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
49
|
-
var register_ = __webpack_require__("@lynx-js/rspeedy/register");
|
|
50
53
|
var debug = __webpack_require__("./src/debug.ts");
|
|
51
54
|
const resolveConfigPath = (root, customConfig)=>{
|
|
52
55
|
if (customConfig) {
|
|
53
|
-
(0, debug.
|
|
56
|
+
(0, debug.Yz)(`load custom config file ${customConfig} from ${root}`);
|
|
54
57
|
const customConfigPath = (0, external_node_path_.isAbsolute)(customConfig) ? customConfig : (0, external_node_path_.join)(root, customConfig);
|
|
55
58
|
if (external_node_fs_["default"].existsSync(customConfigPath)) return customConfigPath;
|
|
56
59
|
throw new Error(`Cannot find config file: ${picocolors_default().dim(customConfigPath)}`);
|
|
@@ -62,10 +65,10 @@ export const __webpack_modules__ = {
|
|
|
62
65
|
'lynx.config.mjs'
|
|
63
66
|
];
|
|
64
67
|
for (const file of CONFIG_FILES){
|
|
65
|
-
(0, debug.
|
|
68
|
+
(0, debug.Yz)(`load default config file ${file} from ${root}`);
|
|
66
69
|
const configFile = (0, external_node_path_.join)(root, file);
|
|
67
70
|
if (external_node_fs_["default"].existsSync(configFile)) {
|
|
68
|
-
(0, debug.
|
|
71
|
+
(0, debug.Yz)(`default config ${configFile} found`);
|
|
69
72
|
return configFile;
|
|
70
73
|
}
|
|
71
74
|
}
|
|
@@ -77,9 +80,9 @@ export const __webpack_modules__ = {
|
|
|
77
80
|
async function loadConfig(loadConfigOptions) {
|
|
78
81
|
let { configPath } = loadConfigOptions;
|
|
79
82
|
if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
|
|
80
|
-
const specifier =
|
|
83
|
+
const specifier = pathToFileURL(configPath).toString();
|
|
81
84
|
let unregister;
|
|
82
|
-
unregister = shouldUseNativeImport(configPath) ? ()=>{} :
|
|
85
|
+
unregister = shouldUseNativeImport(configPath) ? ()=>{} : register({
|
|
83
86
|
load: !hasNativeTSSupport(),
|
|
84
87
|
resolve: true
|
|
85
88
|
});
|
|
@@ -157,11 +160,14 @@ export const __webpack_modules__ = {
|
|
|
157
160
|
},
|
|
158
161
|
"./src/cli/watch.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
159
162
|
__webpack_require__.d(__webpack_exports__, {
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
G: ()=>getWatchedFiles,
|
|
164
|
+
N: ()=>watchFiles
|
|
162
165
|
});
|
|
163
166
|
async function watchFiles(files, callback) {
|
|
164
|
-
const chokidar = await
|
|
167
|
+
const chokidar = await Promise.all([
|
|
168
|
+
__webpack_require__.e("vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js"),
|
|
169
|
+
__webpack_require__.e("events-fs-fs_promises-os-path-stream")
|
|
170
|
+
]).then(__webpack_require__.bind(__webpack_require__, "../../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
|
|
165
171
|
const watcher = chokidar.default.watch(files, {
|
|
166
172
|
ignoreInitial: true,
|
|
167
173
|
ignorePermissionErrors: true
|
|
@@ -199,7 +205,7 @@ export const __webpack_modules__ = {
|
|
|
199
205
|
},
|
|
200
206
|
"./src/create-rspeedy.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
201
207
|
__webpack_require__.d(__webpack_exports__, {
|
|
202
|
-
|
|
208
|
+
x: ()=>createRspeedy
|
|
203
209
|
});
|
|
204
210
|
var external_node_path_ = __webpack_require__("node:path");
|
|
205
211
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
@@ -217,7 +223,7 @@ export const __webpack_modules__ = {
|
|
|
217
223
|
inlineScripts: !enableChunkSplitting
|
|
218
224
|
},
|
|
219
225
|
performance: {
|
|
220
|
-
profile: (0, debug.
|
|
226
|
+
profile: (0, debug._o)() ? true : void 0
|
|
221
227
|
},
|
|
222
228
|
tools: {
|
|
223
229
|
rsdoctor: {
|
|
@@ -243,13 +249,13 @@ export const __webpack_modules__ = {
|
|
|
243
249
|
const DEFAULT_ENTRY = './src/index.js';
|
|
244
250
|
function toRsbuildEntry(entry) {
|
|
245
251
|
if (void 0 === entry) {
|
|
246
|
-
(0, debug.
|
|
252
|
+
(0, debug.Yz)(`Using default entry ${DEFAULT_ENTRY}`);
|
|
247
253
|
return {
|
|
248
254
|
main: DEFAULT_ENTRY
|
|
249
255
|
};
|
|
250
256
|
}
|
|
251
257
|
if (Array.isArray(entry) || 'string' == typeof entry) {
|
|
252
|
-
(0, debug.
|
|
258
|
+
(0, debug.Yz)(()=>`Using single entry ${[
|
|
253
259
|
''
|
|
254
260
|
].concat(entry).join('\n - ')}`);
|
|
255
261
|
return {
|
|
@@ -258,7 +264,7 @@ export const __webpack_modules__ = {
|
|
|
258
264
|
}
|
|
259
265
|
return Object.fromEntries(Object.entries(entry).map(([key, value])=>{
|
|
260
266
|
if (Array.isArray(value) || 'string' == typeof value) {
|
|
261
|
-
(0, debug.
|
|
267
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value);
|
|
262
268
|
return [
|
|
263
269
|
key,
|
|
264
270
|
{
|
|
@@ -266,7 +272,7 @@ export const __webpack_modules__ = {
|
|
|
266
272
|
}
|
|
267
273
|
];
|
|
268
274
|
}
|
|
269
|
-
(0, debug.
|
|
275
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value.import ?? DEFAULT_ENTRY);
|
|
270
276
|
if (void 0 === value.import) return [
|
|
271
277
|
key,
|
|
272
278
|
{
|
|
@@ -384,5 +390,11 @@ export const __webpack_modules__ = {
|
|
|
384
390
|
}
|
|
385
391
|
});
|
|
386
392
|
}
|
|
393
|
+
},
|
|
394
|
+
"node:fs": function(module) {
|
|
395
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
|
|
396
|
+
},
|
|
397
|
+
"node:path": function(module) {
|
|
398
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
387
399
|
}
|
|
388
400
|
};
|
package/dist/src_cli_exit_ts.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import node_process from "node:process";
|
|
2
|
+
export const __webpack_id__ = "src_cli_exit_ts";
|
|
1
3
|
export const __webpack_ids__ = [
|
|
2
4
|
"src_cli_exit_ts"
|
|
3
5
|
];
|
|
@@ -7,7 +9,6 @@ export const __webpack_modules__ = {
|
|
|
7
9
|
exit: ()=>exit_exit
|
|
8
10
|
});
|
|
9
11
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
10
|
-
var external_node_process_ = __webpack_require__("node:process");
|
|
11
12
|
const asyncCallbacks = new Set();
|
|
12
13
|
const callbacks = new Set();
|
|
13
14
|
let isCalled = false;
|
|
@@ -18,7 +19,7 @@ export const __webpack_modules__ = {
|
|
|
18
19
|
if (asyncCallbacks.size > 0 && isSynchronous) console.error("SYNCHRONOUS TERMINATION NOTICE: When explicitly exiting the process via process.exit or via a parent process, asynchronous tasks in your exitHooks will not run. Either remove these tasks, use gracefulExit() instead of process.exit(), or ensure your parent process sends a SIGINT to the process running this code.");
|
|
19
20
|
const exitCode = 128 + signal;
|
|
20
21
|
const done = (force = false)=>{
|
|
21
|
-
if (true === force || true === shouldManuallyExit)
|
|
22
|
+
if (true === force || true === shouldManuallyExit) node_process.exit(exitCode);
|
|
22
23
|
};
|
|
23
24
|
for (const callback of callbacks)callback(exitCode);
|
|
24
25
|
if (isSynchronous) return void done();
|
|
@@ -45,11 +46,11 @@ export const __webpack_modules__ = {
|
|
|
45
46
|
else asyncCallbacks.add(asyncCallbackConfig);
|
|
46
47
|
if (!isRegistered) {
|
|
47
48
|
isRegistered = true;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
node_process.once('beforeExit', exit.bind(void 0, true, false, -128));
|
|
50
|
+
node_process.once('SIGINT', exit.bind(void 0, true, false, 2));
|
|
51
|
+
node_process.once('SIGTERM', exit.bind(void 0, true, false, 15));
|
|
52
|
+
node_process.once('exit', exit.bind(void 0, false, true, 0));
|
|
53
|
+
node_process.on('message', (message)=>{
|
|
53
54
|
if ('shutdown' === message) exit(true, true, -128);
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -96,15 +97,15 @@ export const __webpack_modules__ = {
|
|
|
96
97
|
});
|
|
97
98
|
let previousSignal = null;
|
|
98
99
|
const exit_exit = (signal = 0)=>{
|
|
99
|
-
if (null !== previousSignal) (0, debug.
|
|
100
|
+
if (null !== previousSignal) (0, debug.Yz)(`graceful exit called multiple times, current: ${signal}, previous: ${previousSignal}`);
|
|
100
101
|
previousSignal = signal;
|
|
101
|
-
(0, debug.
|
|
102
|
+
(0, debug.Yz)(`graceful exit process with signal: ${signal}`);
|
|
102
103
|
gracefulExit(signal);
|
|
103
104
|
};
|
|
104
105
|
async function exit_onExit(signal) {
|
|
105
106
|
const duration = Date.now() - start;
|
|
106
|
-
(0, debug.
|
|
107
|
-
(0, debug.
|
|
107
|
+
(0, debug.Yz)(`exit hook fired with signal: ${signal}, duration: ${duration}`);
|
|
108
|
+
(0, debug.Yz)(`awaiting exit promises(length: ${exitPromises.length})...`);
|
|
108
109
|
await Promise.allSettled(exitPromises);
|
|
109
110
|
}
|
|
110
111
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { register } from "@lynx-js/rspeedy/register";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
5
|
+
export const __webpack_id__ = "src_cli_inspect_ts";
|
|
1
6
|
export const __webpack_ids__ = [
|
|
2
7
|
"src_cli_inspect_ts"
|
|
3
8
|
];
|
|
4
9
|
export const __webpack_modules__ = {
|
|
5
10
|
"./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
11
|
__webpack_require__.d(__webpack_exports__, {
|
|
7
|
-
|
|
12
|
+
T: ()=>init
|
|
8
13
|
});
|
|
9
14
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
10
15
|
var external_node_path_ = __webpack_require__("node:path");
|
|
11
|
-
var external_node_url_ = __webpack_require__("node:url");
|
|
12
16
|
var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
13
17
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
14
|
-
var register_ = __webpack_require__("@lynx-js/rspeedy/register");
|
|
15
18
|
var debug = __webpack_require__("./src/debug.ts");
|
|
16
19
|
const resolveConfigPath = (root, customConfig)=>{
|
|
17
20
|
if (customConfig) {
|
|
18
|
-
(0, debug.
|
|
21
|
+
(0, debug.Yz)(`load custom config file ${customConfig} from ${root}`);
|
|
19
22
|
const customConfigPath = (0, external_node_path_.isAbsolute)(customConfig) ? customConfig : (0, external_node_path_.join)(root, customConfig);
|
|
20
23
|
if (external_node_fs_["default"].existsSync(customConfigPath)) return customConfigPath;
|
|
21
24
|
throw new Error(`Cannot find config file: ${picocolors_default().dim(customConfigPath)}`);
|
|
@@ -27,10 +30,10 @@ export const __webpack_modules__ = {
|
|
|
27
30
|
'lynx.config.mjs'
|
|
28
31
|
];
|
|
29
32
|
for (const file of CONFIG_FILES){
|
|
30
|
-
(0, debug.
|
|
33
|
+
(0, debug.Yz)(`load default config file ${file} from ${root}`);
|
|
31
34
|
const configFile = (0, external_node_path_.join)(root, file);
|
|
32
35
|
if (external_node_fs_["default"].existsSync(configFile)) {
|
|
33
|
-
(0, debug.
|
|
36
|
+
(0, debug.Yz)(`default config ${configFile} found`);
|
|
34
37
|
return configFile;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -42,9 +45,9 @@ export const __webpack_modules__ = {
|
|
|
42
45
|
async function loadConfig(loadConfigOptions) {
|
|
43
46
|
let { configPath } = loadConfigOptions;
|
|
44
47
|
if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
|
|
45
|
-
const specifier =
|
|
48
|
+
const specifier = pathToFileURL(configPath).toString();
|
|
46
49
|
let unregister;
|
|
47
|
-
unregister = shouldUseNativeImport(configPath) ? ()=>{} :
|
|
50
|
+
unregister = shouldUseNativeImport(configPath) ? ()=>{} : register({
|
|
48
51
|
load: !hasNativeTSSupport(),
|
|
49
52
|
resolve: true
|
|
50
53
|
});
|
|
@@ -131,8 +134,8 @@ export const __webpack_modules__ = {
|
|
|
131
134
|
var _init_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/cli/init.ts");
|
|
132
135
|
async function inspect(cwd, inspectOptions) {
|
|
133
136
|
try {
|
|
134
|
-
const { createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_3__.
|
|
135
|
-
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__.
|
|
137
|
+
const { createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_3__.T)(cwd, inspectOptions);
|
|
138
|
+
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__.x)(createRspeedyOptions);
|
|
136
139
|
await rspeedy.inspectConfig({
|
|
137
140
|
mode: inspectOptions.mode ?? rspeedy.getRspeedyConfig().mode ?? 'development',
|
|
138
141
|
verbose: inspectOptions.verbose ?? false,
|
|
@@ -148,7 +151,7 @@ export const __webpack_modules__ = {
|
|
|
148
151
|
},
|
|
149
152
|
"./src/create-rspeedy.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
150
153
|
__webpack_require__.d(__webpack_exports__, {
|
|
151
|
-
|
|
154
|
+
x: ()=>createRspeedy
|
|
152
155
|
});
|
|
153
156
|
var external_node_path_ = __webpack_require__("node:path");
|
|
154
157
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
@@ -166,7 +169,7 @@ export const __webpack_modules__ = {
|
|
|
166
169
|
inlineScripts: !enableChunkSplitting
|
|
167
170
|
},
|
|
168
171
|
performance: {
|
|
169
|
-
profile: (0, debug.
|
|
172
|
+
profile: (0, debug._o)() ? true : void 0
|
|
170
173
|
},
|
|
171
174
|
tools: {
|
|
172
175
|
rsdoctor: {
|
|
@@ -192,13 +195,13 @@ export const __webpack_modules__ = {
|
|
|
192
195
|
const DEFAULT_ENTRY = './src/index.js';
|
|
193
196
|
function toRsbuildEntry(entry) {
|
|
194
197
|
if (void 0 === entry) {
|
|
195
|
-
(0, debug.
|
|
198
|
+
(0, debug.Yz)(`Using default entry ${DEFAULT_ENTRY}`);
|
|
196
199
|
return {
|
|
197
200
|
main: DEFAULT_ENTRY
|
|
198
201
|
};
|
|
199
202
|
}
|
|
200
203
|
if (Array.isArray(entry) || 'string' == typeof entry) {
|
|
201
|
-
(0, debug.
|
|
204
|
+
(0, debug.Yz)(()=>`Using single entry ${[
|
|
202
205
|
''
|
|
203
206
|
].concat(entry).join('\n - ')}`);
|
|
204
207
|
return {
|
|
@@ -207,7 +210,7 @@ export const __webpack_modules__ = {
|
|
|
207
210
|
}
|
|
208
211
|
return Object.fromEntries(Object.entries(entry).map(([key, value])=>{
|
|
209
212
|
if (Array.isArray(value) || 'string' == typeof value) {
|
|
210
|
-
(0, debug.
|
|
213
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value);
|
|
211
214
|
return [
|
|
212
215
|
key,
|
|
213
216
|
{
|
|
@@ -215,7 +218,7 @@ export const __webpack_modules__ = {
|
|
|
215
218
|
}
|
|
216
219
|
];
|
|
217
220
|
}
|
|
218
|
-
(0, debug.
|
|
221
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value.import ?? DEFAULT_ENTRY);
|
|
219
222
|
if (void 0 === value.import) return [
|
|
220
223
|
key,
|
|
221
224
|
{
|
|
@@ -333,5 +336,11 @@ export const __webpack_modules__ = {
|
|
|
333
336
|
}
|
|
334
337
|
});
|
|
335
338
|
}
|
|
339
|
+
},
|
|
340
|
+
"node:fs": function(module) {
|
|
341
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
|
|
342
|
+
},
|
|
343
|
+
"node:path": function(module) {
|
|
344
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
336
345
|
}
|
|
337
346
|
};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { register } from "@lynx-js/rspeedy/register";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
5
|
+
export const __webpack_id__ = "src_cli_preview_ts";
|
|
1
6
|
export const __webpack_ids__ = [
|
|
2
7
|
"src_cli_preview_ts"
|
|
3
8
|
];
|
|
4
9
|
export const __webpack_modules__ = {
|
|
5
10
|
"./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
11
|
__webpack_require__.d(__webpack_exports__, {
|
|
7
|
-
|
|
12
|
+
T: ()=>init
|
|
8
13
|
});
|
|
9
14
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
10
15
|
var external_node_path_ = __webpack_require__("node:path");
|
|
11
|
-
var external_node_url_ = __webpack_require__("node:url");
|
|
12
16
|
var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
13
17
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
14
|
-
var register_ = __webpack_require__("@lynx-js/rspeedy/register");
|
|
15
18
|
var debug = __webpack_require__("./src/debug.ts");
|
|
16
19
|
const resolveConfigPath = (root, customConfig)=>{
|
|
17
20
|
if (customConfig) {
|
|
18
|
-
(0, debug.
|
|
21
|
+
(0, debug.Yz)(`load custom config file ${customConfig} from ${root}`);
|
|
19
22
|
const customConfigPath = (0, external_node_path_.isAbsolute)(customConfig) ? customConfig : (0, external_node_path_.join)(root, customConfig);
|
|
20
23
|
if (external_node_fs_["default"].existsSync(customConfigPath)) return customConfigPath;
|
|
21
24
|
throw new Error(`Cannot find config file: ${picocolors_default().dim(customConfigPath)}`);
|
|
@@ -27,10 +30,10 @@ export const __webpack_modules__ = {
|
|
|
27
30
|
'lynx.config.mjs'
|
|
28
31
|
];
|
|
29
32
|
for (const file of CONFIG_FILES){
|
|
30
|
-
(0, debug.
|
|
33
|
+
(0, debug.Yz)(`load default config file ${file} from ${root}`);
|
|
31
34
|
const configFile = (0, external_node_path_.join)(root, file);
|
|
32
35
|
if (external_node_fs_["default"].existsSync(configFile)) {
|
|
33
|
-
(0, debug.
|
|
36
|
+
(0, debug.Yz)(`default config ${configFile} found`);
|
|
34
37
|
return configFile;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -42,9 +45,9 @@ export const __webpack_modules__ = {
|
|
|
42
45
|
async function loadConfig(loadConfigOptions) {
|
|
43
46
|
let { configPath } = loadConfigOptions;
|
|
44
47
|
if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
|
|
45
|
-
const specifier =
|
|
48
|
+
const specifier = pathToFileURL(configPath).toString();
|
|
46
49
|
let unregister;
|
|
47
|
-
unregister = shouldUseNativeImport(configPath) ? ()=>{} :
|
|
50
|
+
unregister = shouldUseNativeImport(configPath) ? ()=>{} : register({
|
|
48
51
|
load: !hasNativeTSSupport(),
|
|
49
52
|
resolve: true
|
|
50
53
|
});
|
|
@@ -134,8 +137,8 @@ export const __webpack_modules__ = {
|
|
|
134
137
|
var _init_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/cli/init.ts");
|
|
135
138
|
async function preview(cwd, previewOptions) {
|
|
136
139
|
try {
|
|
137
|
-
const { createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.
|
|
138
|
-
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_3__.
|
|
140
|
+
const { createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.T)(cwd, previewOptions);
|
|
141
|
+
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_3__.x)(createRspeedyOptions);
|
|
139
142
|
await rspeedy.initConfigs();
|
|
140
143
|
const { distPath } = rspeedy.context;
|
|
141
144
|
if (!node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].existsSync(distPath)) throw new Error(`The output directory ${picocolors__WEBPACK_IMPORTED_MODULE_5___default().yellow(distPath)} does not exist, please build the project before previewing.`);
|
|
@@ -150,7 +153,7 @@ export const __webpack_modules__ = {
|
|
|
150
153
|
},
|
|
151
154
|
"./src/create-rspeedy.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
152
155
|
__webpack_require__.d(__webpack_exports__, {
|
|
153
|
-
|
|
156
|
+
x: ()=>createRspeedy
|
|
154
157
|
});
|
|
155
158
|
var external_node_path_ = __webpack_require__("node:path");
|
|
156
159
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
@@ -168,7 +171,7 @@ export const __webpack_modules__ = {
|
|
|
168
171
|
inlineScripts: !enableChunkSplitting
|
|
169
172
|
},
|
|
170
173
|
performance: {
|
|
171
|
-
profile: (0, debug.
|
|
174
|
+
profile: (0, debug._o)() ? true : void 0
|
|
172
175
|
},
|
|
173
176
|
tools: {
|
|
174
177
|
rsdoctor: {
|
|
@@ -194,13 +197,13 @@ export const __webpack_modules__ = {
|
|
|
194
197
|
const DEFAULT_ENTRY = './src/index.js';
|
|
195
198
|
function toRsbuildEntry(entry) {
|
|
196
199
|
if (void 0 === entry) {
|
|
197
|
-
(0, debug.
|
|
200
|
+
(0, debug.Yz)(`Using default entry ${DEFAULT_ENTRY}`);
|
|
198
201
|
return {
|
|
199
202
|
main: DEFAULT_ENTRY
|
|
200
203
|
};
|
|
201
204
|
}
|
|
202
205
|
if (Array.isArray(entry) || 'string' == typeof entry) {
|
|
203
|
-
(0, debug.
|
|
206
|
+
(0, debug.Yz)(()=>`Using single entry ${[
|
|
204
207
|
''
|
|
205
208
|
].concat(entry).join('\n - ')}`);
|
|
206
209
|
return {
|
|
@@ -209,7 +212,7 @@ export const __webpack_modules__ = {
|
|
|
209
212
|
}
|
|
210
213
|
return Object.fromEntries(Object.entries(entry).map(([key, value])=>{
|
|
211
214
|
if (Array.isArray(value) || 'string' == typeof value) {
|
|
212
|
-
(0, debug.
|
|
215
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value);
|
|
213
216
|
return [
|
|
214
217
|
key,
|
|
215
218
|
{
|
|
@@ -217,7 +220,7 @@ export const __webpack_modules__ = {
|
|
|
217
220
|
}
|
|
218
221
|
];
|
|
219
222
|
}
|
|
220
|
-
(0, debug.
|
|
223
|
+
(0, debug.Iv)(`Using multiple entries - ${key}`, value.import ?? DEFAULT_ENTRY);
|
|
221
224
|
if (void 0 === value.import) return [
|
|
222
225
|
key,
|
|
223
226
|
{
|
|
@@ -335,5 +338,11 @@ export const __webpack_modules__ = {
|
|
|
335
338
|
}
|
|
336
339
|
});
|
|
337
340
|
}
|
|
341
|
+
},
|
|
342
|
+
"node:fs": function(module) {
|
|
343
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
|
|
344
|
+
},
|
|
345
|
+
"node:path": function(module) {
|
|
346
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
338
347
|
}
|
|
339
348
|
};
|