Skip to content

Commit 238cc90

Browse files
committed
feat: change build value
1 parent 78196b7 commit 238cc90

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/rspack-cli/src/cli.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,11 @@ export class RspackCLI {
170170

171171
// false is also a valid value for sourcemap, so don't override it
172172
if (typeof item.devtool === "undefined") {
173-
item.devtool = isBuild ? "source-map" : "cheap-module-source-map";
173+
item.devtool = isBuild ? false : "eval";
174174
}
175175
// user parameters always has highest priority than default devtool and config devtool
176176
if (typeof options.devtool !== "undefined") {
177-
item.devtool = isBuild
178-
? item.devtool
179-
: (options.devtool as RspackOptions["devtool"]);
177+
item.devtool = options.devtool as RspackOptions["devtool"];
180178
}
181179

182180
if (isServe) {

packages/rspack-cli/src/utils/options.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ export const commonOptionsForBuildAndServe = (yargs: yargs.Argv) => {
5959
},
6060
devtool: {
6161
type: "string",
62-
default: "eval",
63-
describe: "devtool",
62+
describe:
63+
"devtool in development default value eval, in production default value false",
6464
alias: "d",
65-
coerce: arg => {
66-
if (arg === "true") return "eval"; // --devtool true equal to "eval"
67-
if (arg === "false") return false; // --devtool false disabled
65+
coerce: (arg): string | boolean => {
66+
if (arg === "true") return "eval";
67+
if (arg === "false") return false;
6868
return arg;
6969
}
7070
}

0 commit comments

Comments
 (0)