mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 12:01:40 +08:00
This CL adds a new build rule "minify_json" that takes a list of JSON files, minifies them, and puts the result into then "gen/" directory. The i18n module uses the new rule to minify the locale JSON, reducing the raw size per locale file 10-15%. R=tvanderlippe@chromium.org Fixed: 1293324 Change-Id: I0aabc5cdea7957334dfe21304e117dc23a563606 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431345 Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
29 lines
656 B
Plaintext
29 lines
656 B
Plaintext
# Copyright 2022 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import("./node.gni")
|
|
import("./vars.gni")
|
|
|
|
template("minify_json") {
|
|
node_action(target_name) {
|
|
forward_variables_from(invoker, [ "sources" ])
|
|
|
|
script = "scripts/build/ninja/minify-json-files.js"
|
|
|
|
_src = rebase_path(".", root_build_dir)
|
|
_dest = rebase_path(target_gen_dir, root_build_dir)
|
|
|
|
args = [
|
|
_src,
|
|
_dest,
|
|
string_join(",", sources),
|
|
]
|
|
|
|
outputs = []
|
|
foreach(_input, sources) {
|
|
outputs += [ "$target_gen_dir/$_input" ]
|
|
}
|
|
}
|
|
}
|