@rspack/cli 1.2.3 → 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.js CHANGED
@@ -175,6 +175,11 @@ var __webpack_exports__ = {};
175
175
  type: "array",
176
176
  string: true,
177
177
  describe: "Name of the configuration to use."
178
+ },
179
+ "config-loader": {
180
+ type: "string",
181
+ default: "register",
182
+ describe: "Specify the loader to load the config file, can be `native` or `register`."
178
183
  }
179
184
  }).alias({
180
185
  v: "version",
@@ -549,12 +554,12 @@ var __webpack_exports__ = {};
549
554
  if (options.config) {
550
555
  const configPath = external_node_path_default().resolve(cwd, options.config);
551
556
  if (!external_node_fs_default().existsSync(configPath)) throw new Error(`config file "${configPath}" not found.`);
552
- if (isTsFile(configPath)) await registerLoader(configPath);
557
+ if (isTsFile(configPath) && "register" === options["config-loader"]) await registerLoader(configPath);
553
558
  return crossImport(configPath, cwd);
554
559
  }
555
560
  const defaultConfig = utils_findConfig(external_node_path_default().resolve(cwd, loadConfig_DEFAULT_CONFIG_NAME));
556
561
  if (defaultConfig) {
557
- if (isTsFile(defaultConfig)) await registerLoader(defaultConfig);
562
+ if (isTsFile(defaultConfig) && "register" === options["config-loader"]) await registerLoader(defaultConfig);
558
563
  return crossImport(defaultConfig, cwd);
559
564
  }
560
565
  return {};
package/dist/index.mjs CHANGED
@@ -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",
@@ -525,12 +530,12 @@ async function loadRspackConfig(options, cwd = process.cwd()) {
525
530
  if (options.config) {
526
531
  const configPath = external_node_path_["default"].resolve(cwd, options.config);
527
532
  if (!external_node_fs_["default"].existsSync(configPath)) throw new Error(`config file "${configPath}" not found.`);
528
- if (isTsFile(configPath)) await registerLoader(configPath);
533
+ if (isTsFile(configPath) && "register" === options["config-loader"]) await registerLoader(configPath);
529
534
  return crossImport(configPath, cwd);
530
535
  }
531
536
  const defaultConfig = utils_findConfig(external_node_path_["default"].resolve(cwd, loadConfig_DEFAULT_CONFIG_NAME));
532
537
  if (defaultConfig) {
533
- if (isTsFile(defaultConfig)) await registerLoader(defaultConfig);
538
+ if (isTsFile(defaultConfig) && "register" === options["config-loader"]) await registerLoader(defaultConfig);
534
539
  return crossImport(defaultConfig, cwd);
535
540
  }
536
541
  return {};
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.3",
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,7 +35,7 @@
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
41
  "@rslib/core": "0.4.0",
@@ -48,8 +48,8 @@
48
48
  "execa": "^5.0.0",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.7.3",
51
- "@rspack/tracing": "1.2.3",
52
- "@rspack/core": "1.2.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",