Dedup js source list in BUILD.gn
@@ -52,6 +52,36 @@ main_extern = [
":msg_rs",
]
+ts_sources = [
+ "js/assets.ts",
+ "js/compiler.ts",
+ "js/console.ts",
+ "js/deno.ts",
+ "js/dispatch.ts",
+ "js/errors.ts",
+ "js/fetch.ts",
+ "js/fetch_types.d.ts",
+ "js/global-eval.ts",
+ "js/globals.ts",
+ "js/libdeno.ts",
+ "js/main.ts",
+ "js/mkdir.ts",
+ "js/mock_builtin.js",
+ "js/os.ts",
+ "js/plugins.d.ts",
+ "js/read_file.ts",
+ "js/remove.ts",
+ "js/rename.ts",
+ "js/stat.ts",
+ "js/text_encoding.ts",
+ "js/timers.ts",
+ "js/types.ts",
+ "js/util.ts",
+ "js/v8_source_maps.ts",
+ "js/write_file.ts",
+ "tsconfig.json",
+]
+
rust_executable("deno") {
source_root = "src/main.rs"
extern = main_extern
@@ -186,30 +216,7 @@ executable("snapshot_creator") {
# in the runtime bundle
run_node("gen_declarations") {
out_dir = target_gen_dir
- sources = [
- "js/assets.ts",
- "js/compiler.ts",
- "js/console.ts",
- "js/deno.ts",
- "js/dispatch.ts",
- "js/errors.ts",
- "js/fetch.ts",
- "js/global-eval.ts",
- "js/globals.ts",
- "js/mkdir.ts",
- "js/os.ts",
- "js/read_file.ts",
- "js/rename.ts",
- "js/remove.ts",
- "js/stat.ts",
- "js/text_encoding.ts",
- "js/timers.ts",
- "js/tsconfig.generated.json",
- "js/types.ts",
- "js/util.ts",
- "js/v8_source_maps.ts",
- "js/write_file.ts",
- ]
+ sources = ts_sources
outputs = [
"$out_dir/types/globals.d.ts",
]
@@ -229,32 +236,8 @@ run_node("gen_declarations") {
run_node("bundle") {
out_dir = "$target_gen_dir/bundle/"
- sources = [
- "js/assets.ts",
- "js/compiler.ts",
- "js/console.ts",
- "js/dispatch.ts",
- "js/errors.ts",
- "js/fetch.ts",
- "js/fetch_types.d.ts",
- "js/globals.ts",
- "js/main.ts",
- "js/mkdir.ts",
- "js/os.ts",
- "js/plugins.d.ts",
- "js/read_file.ts",
- "js/rename.ts",
- "js/remove.ts",
- "js/stat.ts",
- "js/text_encoding.ts",
- "js/timers.ts",
- "js/types.ts",
- "js/util.ts",
- "js/v8_source_maps.ts",
- "js/write_file.ts",
+ sources = ts_sources + [
"rollup.config.js",
- "src/msg.fbs",
- "tsconfig.json",
]
outputs = [
out_dir + "main.js",
