@rspack-debug/cli 1.4.4 → 1.4.7

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
@@ -174,10 +174,14 @@ var __webpack_exports__ = {};
174
174
  describe: "env passed to config function"
175
175
  },
176
176
  devtool: {
177
- type: "boolean",
178
- default: false,
179
- describe: "devtool",
180
- alias: "d"
177
+ type: "string",
178
+ describe: "Specify a developer tool for debugging. Defaults to `cheap-module-source-map` in development and `source-map` in production.",
179
+ alias: "d",
180
+ coerce: (arg)=>{
181
+ if ("true" === arg) return "source-map";
182
+ if ("false" === arg || "" === arg.trim()) return false;
183
+ return arg;
184
+ }
181
185
  }
182
186
  }).alias({
183
187
  v: "version",
@@ -555,7 +559,13 @@ var __webpack_exports__ = {};
555
559
  throw error;
556
560
  }
557
561
  };
562
+ const checkIsMultiRspackOptions = (config)=>Array.isArray(config);
558
563
  async function loadExtendedConfig(config, configPath, cwd, options) {
564
+ if (checkIsMultiRspackOptions(config)) {
565
+ const extendedConfigs = await Promise.all(config.map((item)=>loadExtendedConfig(item, configPath, cwd, options)));
566
+ extendedConfigs.parallelism = config.parallelism;
567
+ return extendedConfigs;
568
+ }
559
569
  if (!("extends" in config) || !config.extends) return config;
560
570
  const extendsList = Array.isArray(config.extends) ? config.extends : [
561
571
  config.extends
@@ -710,6 +720,7 @@ var __webpack_exports__ = {};
710
720
  if (!item.mode) item.mode = isBuild ? "production" : "development";
711
721
  if (options.mode) item.mode = options.mode;
712
722
  if (void 0 === item.devtool) item.devtool = isBuild ? "source-map" : "cheap-module-source-map";
723
+ if (void 0 !== options.devtool) item.devtool = options.devtool;
713
724
  if (isServe) {
714
725
  const installed = (item.plugins ||= []).find((item)=>item instanceof core_.ProgressPlugin);
715
726
  if (!installed) (item.plugins ??= []).push(new core_.ProgressPlugin());
package/dist/index.mjs CHANGED
@@ -139,10 +139,14 @@ const commonOptionsForBuildAndServe = (yargs)=>yargs.options({
139
139
  describe: "env passed to config function"
140
140
  },
141
141
  devtool: {
142
- type: "boolean",
143
- default: false,
144
- describe: "devtool",
145
- alias: "d"
142
+ type: "string",
143
+ describe: "Specify a developer tool for debugging. Defaults to `cheap-module-source-map` in development and `source-map` in production.",
144
+ alias: "d",
145
+ coerce: (arg)=>{
146
+ if ("true" === arg) return "source-map";
147
+ if ("false" === arg || "" === arg.trim()) return false;
148
+ return arg;
149
+ }
146
150
  }
147
151
  }).alias({
148
152
  v: "version",
@@ -519,7 +523,13 @@ const registerLoader = async (configPath)=>{
519
523
  throw error;
520
524
  }
521
525
  };
526
+ const checkIsMultiRspackOptions = (config)=>Array.isArray(config);
522
527
  async function loadExtendedConfig(config, configPath, cwd, options) {
528
+ if (checkIsMultiRspackOptions(config)) {
529
+ const extendedConfigs = await Promise.all(config.map((item)=>loadExtendedConfig(item, configPath, cwd, options)));
530
+ extendedConfigs.parallelism = config.parallelism;
531
+ return extendedConfigs;
532
+ }
523
533
  if (!("extends" in config) || !config.extends) return config;
524
534
  const extendsList = Array.isArray(config.extends) ? config.extends : [
525
535
  config.extends
@@ -674,6 +684,7 @@ class RspackCLI {
674
684
  if (!item.mode) item.mode = isBuild ? "production" : "development";
675
685
  if (options.mode) item.mode = options.mode;
676
686
  if (void 0 === item.devtool) item.devtool = isBuild ? "source-map" : "cheap-module-source-map";
687
+ if (void 0 !== options.devtool) item.devtool = options.devtool;
677
688
  if (isServe) {
678
689
  const installed = (item.plugins ||= []).find((item)=>item instanceof core_.ProgressPlugin);
679
690
  if (!installed) (item.plugins ??= []).push(new core_.ProgressPlugin());
package/dist/types.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface RspackCLIOptions {
26
26
  }
27
27
  export interface RspackBuildCLIOptions extends RspackCLIOptions {
28
28
  entry?: string[];
29
- devtool?: boolean;
29
+ devtool?: string | boolean;
30
30
  mode?: string;
31
31
  watch?: boolean;
32
32
  analyze?: boolean;
@@ -55,10 +55,10 @@ export declare const commonOptionsForBuildAndServe: (yargs: yargs.Argv) => yargs
55
55
  describe: string;
56
56
  };
57
57
  devtool: {
58
- type: "boolean";
59
- default: boolean;
58
+ type: "string";
60
59
  describe: string;
61
60
  alias: string;
61
+ coerce: (arg: any) => string | boolean;
62
62
  };
63
63
  }>>;
64
64
  export declare function normalizeEnv(argv: yargs.Arguments): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/cli",
3
- "version": "1.4.4",
3
+ "version": "1.4.7",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -38,7 +38,7 @@
38
38
  "yargs": "17.7.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@rslib/core": "0.10.0",
41
+ "@rslib/core": "0.10.5",
42
42
  "@types/interpret": "^1.1.3",
43
43
  "@types/rechoir": "^0.6.4",
44
44
  "@types/webpack-bundle-analyzer": "^4.7.0",
@@ -48,7 +48,7 @@
48
48
  "execa": "^5.1.1",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.8.3",
51
- "@rspack/core": "npm:@rspack-debug/core@1.4.4"
51
+ "@rspack/core": "npm:@rspack-debug/core@1.4.7"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@rspack/core": "^1.0.0-alpha || ^1.x"