8e1160fde4
This aligns the code with the GN Style Guide: https://gn.googlesource.com/gn/+/refs/heads/main/docs/style_guide.md#deps Signed-off-by: Darshan Sen <darshan.sen@postman.com>
43 lines
1.3 KiB
Text
43 lines
1.3 KiB
Text
import("../npm.gni")
|
|
|
|
template("webpack_build") {
|
|
assert(defined(invoker.config_file), "Need webpack config file to run")
|
|
assert(defined(invoker.out_file), "Need output file to run")
|
|
assert(defined(invoker.inputs), "Need webpack inputs to run")
|
|
|
|
npm_action(target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"deps",
|
|
"public_deps",
|
|
])
|
|
script = "webpack"
|
|
|
|
inputs = [
|
|
invoker.config_file,
|
|
"//electron/build/webpack/webpack.config.base.js",
|
|
"//electron/tsconfig.json",
|
|
"//electron/yarn.lock",
|
|
"//electron/typings/internal-ambient.d.ts",
|
|
"//electron/typings/internal-electron.d.ts",
|
|
] + invoker.inputs
|
|
|
|
mode = "development"
|
|
if (is_official_build) {
|
|
mode = "production"
|
|
}
|
|
|
|
args = [
|
|
"--config",
|
|
rebase_path(invoker.config_file),
|
|
"--output-filename=" + get_path_info(invoker.out_file, "file"),
|
|
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
|
|
"--env.buildflags=" +
|
|
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
|
|
"--env.mode=" + mode,
|
|
]
|
|
deps += [ "//electron/buildflags" ]
|
|
|
|
outputs = [ invoker.out_file ]
|
|
}
|
|
}
|