@lynx-js/rspeedy 0.9.0 → 0.9.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 +14 -0
- package/dist/index.js +1958 -1864
- package/dist/register/hooks.js +4 -4
- package/dist/src_cli_build_ts.js +2 -1
- package/dist/src_cli_commands_ts.js +2 -2
- package/dist/src_cli_dev_ts.js +2 -1
- package/dist/src_cli_inspect_ts.js +8 -8
- package/dist/src_cli_preview_ts.js +8 -8
- package/dist/src_config_loadConfig_ts-src_create-rspeedy_ts.js +1957 -1863
- package/dist/src_plugins_api_plugin_ts.js +2 -2
- package/dist/src_plugins_rsdoctor_plugin_ts.js +7 -13
- package/dist/src_version_ts.js +1 -1
- package/package.json +8 -8
package/dist/register/hooks.js
CHANGED
|
@@ -505,11 +505,11 @@ const state = {
|
|
|
505
505
|
active: true,
|
|
506
506
|
port: null
|
|
507
507
|
};
|
|
508
|
-
const
|
|
508
|
+
const hooks_initialize = function(data) {
|
|
509
509
|
state.port = data.port;
|
|
510
510
|
data.port.on('message', onMessage);
|
|
511
511
|
};
|
|
512
|
-
const
|
|
512
|
+
const hooks_resolve = async function(specifier, context, nextResolve) {
|
|
513
513
|
try {
|
|
514
514
|
return await nextResolve(specifier, context);
|
|
515
515
|
} catch (err) {
|
|
@@ -520,7 +520,7 @@ const hooks_rslib_entry_resolve = async function(specifier, context, nextResolve
|
|
|
520
520
|
throw err;
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
|
-
const
|
|
523
|
+
const hooks_load = async function(url, context, nextLoad) {
|
|
524
524
|
const fullURL = parseURL(url);
|
|
525
525
|
if (!fullURL) return nextLoad(url, context);
|
|
526
526
|
const { pathname } = fullURL;
|
|
@@ -549,4 +549,4 @@ function parseURL(url) {
|
|
|
549
549
|
return null;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
export {
|
|
552
|
+
export { hooks_initialize as initialize, hooks_load as load, hooks_resolve as resolve };
|
package/dist/src_cli_build_ts.js
CHANGED
|
@@ -23,7 +23,8 @@ export const __webpack_modules__ = {
|
|
|
23
23
|
cwd,
|
|
24
24
|
rspeedyConfig
|
|
25
25
|
};
|
|
26
|
-
if (buildOptions.
|
|
26
|
+
if (buildOptions.noEnv) options.loadEnv = false;
|
|
27
|
+
else if (buildOptions.envMode) options.loadEnv = {
|
|
27
28
|
mode: buildOptions.envMode
|
|
28
29
|
};
|
|
29
30
|
if (buildOptions.environment) options.environment = buildOptions.environment;
|
|
@@ -9,7 +9,7 @@ export const __webpack_modules__ = {
|
|
|
9
9
|
});
|
|
10
10
|
var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/version.ts");
|
|
11
11
|
function applyCommonOptions(command) {
|
|
12
|
-
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"');
|
|
12
|
+
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"');
|
|
13
13
|
}
|
|
14
14
|
function apply(program) {
|
|
15
15
|
const cwd = process.cwd();
|
|
@@ -52,7 +52,7 @@ export const __webpack_modules__ = {
|
|
|
52
52
|
});
|
|
53
53
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
54
54
|
var package_namespaceObject = {
|
|
55
|
-
i8: "0.9.
|
|
55
|
+
i8: "0.9.2"
|
|
56
56
|
};
|
|
57
57
|
const version = package_namespaceObject.i8;
|
|
58
58
|
const rspackVersion = core_.rspack.rspackVersion;
|
package/dist/src_cli_dev_ts.js
CHANGED
|
@@ -47,7 +47,8 @@ export const __webpack_modules__ = {
|
|
|
47
47
|
cwd,
|
|
48
48
|
rspeedyConfig
|
|
49
49
|
};
|
|
50
|
-
if (devOptions.
|
|
50
|
+
if (devOptions.noEnv) options.loadEnv = false;
|
|
51
|
+
else if (devOptions.envMode) options.loadEnv = {
|
|
51
52
|
mode: devOptions.envMode
|
|
52
53
|
};
|
|
53
54
|
if (devOptions.environment) options.environment = devOptions.environment;
|
|
@@ -17,15 +17,15 @@ export const __webpack_modules__ = {
|
|
|
17
17
|
cwd,
|
|
18
18
|
configPath: inspectOptions.config
|
|
19
19
|
});
|
|
20
|
-
const
|
|
20
|
+
const options = {
|
|
21
21
|
cwd,
|
|
22
|
-
rspeedyConfig
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
rspeedyConfig
|
|
23
|
+
};
|
|
24
|
+
if (inspectOptions.noEnv) options.loadEnv = false;
|
|
25
|
+
else if (inspectOptions.envMode) options.loadEnv = {
|
|
26
|
+
mode: inspectOptions.envMode
|
|
27
|
+
};
|
|
28
|
+
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_3__.S)(options);
|
|
29
29
|
await rspeedy.inspectConfig({
|
|
30
30
|
mode: inspectOptions.mode ?? process.env['NODE_ENV'] ?? 'development',
|
|
31
31
|
verbose: inspectOptions.verbose ?? false,
|
|
@@ -25,15 +25,15 @@ export const __webpack_modules__ = {
|
|
|
25
25
|
rspeedyConfig.server ??= {};
|
|
26
26
|
rspeedyConfig.server.base = previewOptions.base;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const options = {
|
|
29
29
|
cwd,
|
|
30
|
-
rspeedyConfig
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
rspeedyConfig
|
|
31
|
+
};
|
|
32
|
+
if (previewOptions.noEnv) options.loadEnv = false;
|
|
33
|
+
else if (previewOptions.envMode) options.loadEnv = {
|
|
34
|
+
mode: previewOptions.envMode
|
|
35
|
+
};
|
|
36
|
+
const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_4__.S)(options);
|
|
37
37
|
await rspeedy.initConfigs();
|
|
38
38
|
const { distPath } = rspeedy.context;
|
|
39
39
|
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.`);
|