@rspack/cli 1.2.2 → 1.2.4

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/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__rspack_core__ from "@rspack/core";
2
- import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs";
3
- import * as __WEBPACK_EXTERNAL_MODULE_node_inspector__ from "node:inspector";
4
- import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
5
- import * as __WEBPACK_EXTERNAL_MODULE_node_url__ from "node:url";
6
- import * as __WEBPACK_EXTERNAL_MODULE_node_util__ from "node:util";
1
+ import * as __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__ from "@rspack/core";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__ from "node:inspector";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE_colorette__ from "colorette";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE_yargs__ from "yargs";
9
- import * as __WEBPACK_EXTERNAL_MODULE_yargs_helpers__ from "yargs/helpers";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_yargs_helpers_525217b7__ from "yargs/helpers";
10
10
  var __webpack_modules__ = {
11
11
  "@rspack/core": function(module) {
12
- module.exports = __WEBPACK_EXTERNAL_MODULE__rspack_core__;
12
+ module.exports = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__;
13
13
  },
14
14
  "node:fs": function(module) {
15
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs__;
15
+ module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
16
16
  },
17
17
  "node:inspector": function(module) {
18
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_inspector__;
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__;
19
19
  },
20
20
  "node:path": function(module) {
21
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_path__;
21
+ module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
22
22
  },
23
23
  "node:url": function(module) {
24
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_url__;
24
+ module.exports = __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__;
25
25
  }
26
26
  };
27
27
  var __webpack_module_cache__ = {};
@@ -151,6 +151,11 @@ const commonOptions = (yargs)=>yargs.options({
151
151
  type: "array",
152
152
  string: true,
153
153
  describe: "Name of the configuration to use."
154
+ },
155
+ "config-loader": {
156
+ type: "string",
157
+ default: "register",
158
+ describe: "Specify the loader to load the config file, can be `native` or `register`."
154
159
  }
155
160
  }).alias({
156
161
  v: "version",
@@ -220,9 +225,7 @@ function setBuiltinEnvArg(env, envNameSuffix, value) {
220
225
  const envNames = [
221
226
  `RSPACK_${envNameSuffix}`
222
227
  ];
223
- for (const envName of envNames){
224
- if (!(envName in env)) env[envName] = value;
225
- }
228
+ for (const envName of envNames)if (!(envName in env)) env[envName] = value;
226
229
  }
227
230
  function ensureEnvObject(options) {
228
231
  if (Array.isArray(options.env)) normalizeEnv(options);
@@ -527,12 +530,12 @@ async function loadRspackConfig(options, cwd = process.cwd()) {
527
530
  if (options.config) {
528
531
  const configPath = external_node_path_["default"].resolve(cwd, options.config);
529
532
  if (!external_node_fs_["default"].existsSync(configPath)) throw new Error(`config file "${configPath}" not found.`);
530
- if (isTsFile(configPath)) await registerLoader(configPath);
533
+ if (isTsFile(configPath) && "register" === options["config-loader"]) await registerLoader(configPath);
531
534
  return crossImport(configPath, cwd);
532
535
  }
533
536
  const defaultConfig = utils_findConfig(external_node_path_["default"].resolve(cwd, loadConfig_DEFAULT_CONFIG_NAME));
534
537
  if (defaultConfig) {
535
- if (isTsFile(defaultConfig)) await registerLoader(defaultConfig);
538
+ if (isTsFile(defaultConfig) && "register" === options["config-loader"]) await registerLoader(defaultConfig);
536
539
  return crossImport(defaultConfig, cwd);
537
540
  }
538
541
  return {};
@@ -586,7 +589,7 @@ class RspackCLI {
586
589
  }
587
590
  getLogger() {
588
591
  return {
589
- error: (val)=>console.error(`[rspack-cli] ${this.colors.red(__WEBPACK_EXTERNAL_MODULE_node_util__["default"].format(val))}`),
592
+ error: (val)=>console.error(`[rspack-cli] ${this.colors.red(__WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__["default"].format(val))}`),
590
593
  warn: (val)=>console.warn(`[rspack-cli] ${this.colors.yellow(val)}`),
591
594
  info: (val)=>console.info(`[rspack-cli] ${this.colors.cyan(val)}`),
592
595
  success: (val)=>console.log(`[rspack-cli] ${this.colors.green(val)}`),
@@ -601,7 +604,7 @@ class RspackCLI {
601
604
  this.program.strictCommands(true).strict(true);
602
605
  this.program.middleware(normalizeEnv);
603
606
  this.registerCommands();
604
- await this.program.parseAsync((0, __WEBPACK_EXTERNAL_MODULE_yargs_helpers__.hideBin)(argv));
607
+ await this.program.parseAsync((0, __WEBPACK_EXTERNAL_MODULE_yargs_helpers_525217b7__.hideBin)(argv));
605
608
  }
606
609
  async registerCommands() {
607
610
  const builtinCommands = [
@@ -634,7 +637,7 @@ class RspackCLI {
634
637
  }
635
638
  if (options.profile) item.profile = true;
636
639
  if (process.env.RSPACK_PROFILE) {
637
- const { applyProfile } = await __webpack_require__.e("574").then(__webpack_require__.bind(__webpack_require__, "./src/utils/profile.ts"));
640
+ const { applyProfile } = await __webpack_require__.e("737").then(__webpack_require__.bind(__webpack_require__, "./src/utils/profile.ts"));
638
641
  await applyProfile(process.env.RSPACK_PROFILE, item);
639
642
  }
640
643
  if (options.watch) item.watch = options.watch;
package/dist/types.d.ts CHANGED
@@ -21,6 +21,7 @@ export interface RspackCLIOptions {
21
21
  config?: string;
22
22
  argv?: Record<string, any>;
23
23
  configName?: string[];
24
+ "config-loader"?: string;
24
25
  }
25
26
  export interface RspackBuildCLIOptions extends RspackCLIOptions {
26
27
  entry?: string[];
@@ -1,5 +1,5 @@
1
1
  import type yargs from "yargs";
2
- export declare const commonOptions: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, "entry" | "devtool" | "mode" | "watch" | "env" | "output-path" | "config" | "node-env" | "configName"> & yargs.InferredOptionTypes<{
2
+ export declare const commonOptions: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, "entry" | "devtool" | "mode" | "watch" | "env" | "output-path" | "config" | "node-env" | "configName" | "config-loader"> & yargs.InferredOptionTypes<{
3
3
  config: {
4
4
  g: boolean;
5
5
  type: "string";
@@ -47,6 +47,11 @@ export declare const commonOptions: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit
47
47
  string: true;
48
48
  describe: string;
49
49
  };
50
+ "config-loader": {
51
+ type: "string";
52
+ default: string;
53
+ describe: string;
54
+ };
50
55
  }>>;
51
56
  export declare const previewOptions: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{
52
57
  dir: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.dev",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -35,10 +35,10 @@
35
35
  "interpret": "^3.1.1",
36
36
  "rechoir": "^0.8.0",
37
37
  "webpack-bundle-analyzer": "4.6.1",
38
- "yargs": "17.6.2"
38
+ "yargs": "17.7.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@rslib/core": "0.2.2",
41
+ "@rslib/core": "0.4.0",
42
42
  "@types/interpret": "^1.1.3",
43
43
  "@types/rechoir": "^0.6.1",
44
44
  "@types/webpack-bundle-analyzer": "^4.6.0",
@@ -47,9 +47,9 @@
47
47
  "cross-env": "^7.0.3",
48
48
  "execa": "^5.0.0",
49
49
  "ts-node": "^10.9.2",
50
- "typescript": "^5.7.2",
51
- "@rspack/core": "1.2.2",
52
- "@rspack/tracing": "1.2.2"
50
+ "typescript": "^5.7.3",
51
+ "@rspack/core": "1.2.4",
52
+ "@rspack/tracing": "1.2.4"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@rspack/core": "^1.0.0-alpha || ^1.x",