chore: don't minimize js in development (#28571)
This commit is contained in:
parent
da8c35e3b2
commit
f73d09374e
2 changed files with 7 additions and 1 deletions
|
@ -156,7 +156,7 @@ if ((globalThis.process || binding.process).argv.includes("--profile-electron-in
|
||||||
setImmediate: false
|
setImmediate: false
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: env.mode === 'production',
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
|
|
|
@ -22,6 +22,11 @@ template("webpack_build") {
|
||||||
"//electron/typings/internal-electron.d.ts",
|
"//electron/typings/internal-electron.d.ts",
|
||||||
] + invoker.inputs
|
] + invoker.inputs
|
||||||
|
|
||||||
|
mode = "development"
|
||||||
|
if (is_official_build) {
|
||||||
|
mode = "production"
|
||||||
|
}
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"--config",
|
"--config",
|
||||||
rebase_path(invoker.config_file),
|
rebase_path(invoker.config_file),
|
||||||
|
@ -29,6 +34,7 @@ template("webpack_build") {
|
||||||
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
|
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
|
||||||
"--env.buildflags=" +
|
"--env.buildflags=" +
|
||||||
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
|
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
|
||||||
|
"--env.mode=" + mode,
|
||||||
]
|
]
|
||||||
deps += [ "buildflags" ]
|
deps += [ "buildflags" ]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue