Skip to content

Commit

Permalink
Merge pull request #313 from brave/revert-309-component_resources
Browse files Browse the repository at this point in the history
Revert "let each component handle its own transpiling"
  • Loading branch information
bbondy authored Aug 7, 2018
2 parents 409515d + ff40756 commit c3d0cb0
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 131 deletions.
18 changes: 0 additions & 18 deletions components/brave_adblock_ui/BUILD.gn

This file was deleted.

22 changes: 0 additions & 22 deletions components/brave_new_tab_ui/BUILD.gn

This file was deleted.

17 changes: 0 additions & 17 deletions components/brave_rewards_ui/BUILD.gn

This file was deleted.

24 changes: 0 additions & 24 deletions components/brave_welcome_ui/BUILD.gn

This file was deleted.

42 changes: 0 additions & 42 deletions components/common/typescript.gni

This file was deleted.

40 changes: 34 additions & 6 deletions components/resources/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
import("//tools/grit/grit_rule.gni")

transpile_includes = [
# Brave Adblock Page
"../brave_adblock_ui/brave_adblock.html",
# Brave New Tab
"../brave_new_tab_ui/brave_new_tab.html",
# Brave Rewards
"../brave_rewards_ui/brave_rewards.html",
# Brave Welcome Page
"../brave_welcome_ui/brave_welcome.html"
]

action("transpile_web_uis") {
script = "//brave/script/transpile-web-ui.py"
inputs = transpile_includes
outputs = [
"$target_out_dir/brave_new_tab.bundle.js",
"$target_out_dir/brave_rewards.bundle.js",
"$target_out_dir/brave_welcome.bundle.js",
"$target_out_dir/brave_adblock.bundle.js",
]
gen_dir = rebase_path(root_gen_dir, "//")
args = [
"--target_gen_dir=$gen_dir"
]
if (is_official_build) {
args += [
"--production",
]
}
}

grit("brave_components_resources_grit") {
source = "brave_components_resources.grd"

output_name = "brave_components_resources_new"
inputs = get_target_outputs(":transpile_web_uis")
inputs += transpile_includes

outputs = [
"grit/brave_components_resources.h",
"brave_components_resources.pak",
]
deps = [
"//brave/components/brave_adblock_ui",
"//brave/components/brave_new_tab_ui",
"//brave/components/brave_rewards_ui",
"//brave/components/brave_welcome_ui",
]
deps = [ ":transpile_web_uis" ]
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
Expand Down
2 changes: 1 addition & 1 deletion components/webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
brave_welcome: path.join(__dirname, '../brave_welcome_ui/brave_welcome')
},
output: {
path: process.env.TARGET_GEN_DIR,
path: path.join(__dirname, '..', '..', '..', process.env.TARGET_GEN_DIR, 'brave'),
filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js'
},
Expand Down
2 changes: 1 addition & 1 deletion components/webpack/prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
brave_welcome: path.join(__dirname, '../brave_welcome_ui/brave_welcome')
},
output: {
path: process.env.TARGET_GEN_DIR,
path: path.join(__dirname, '..', '..', '..', process.env.TARGET_GEN_DIR, 'brave'),
filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js'
},
Expand Down

0 comments on commit c3d0cb0

Please sign in to comment.