1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

build: snapshot doesn't need source_map

Continuation of the work done in c113df.
This commit is contained in:
Ryan Dahl 2018-12-11 13:07:31 -05:00
parent c1de50b0ca
commit f230734623
4 changed files with 3 additions and 16 deletions

View file

@ -211,8 +211,7 @@ rust_flatbuffer("msg_rs") {
# Generates $target_gen_dir/snapshot_deno.bin
snapshot("snapshot_deno") {
js = "$target_gen_dir/bundle/main.js"
source_map = "$target_gen_dir/bundle/main.js.map"
source_root = "$target_gen_dir/bundle/main.js"
deps = [
":bundle",
]

View file

@ -98,5 +98,5 @@ v8_executable("test_cc") {
# Generates $target_gen_dir/snapshot_test.bin
snapshot("snapshot_test") {
testonly = true
js = "libdeno_test.js"
source_root = "libdeno_test.js"
}

View file

@ -25,14 +25,9 @@ template("snapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
snapshot_out_bin = "$target_gen_dir/$target_name.bin"
inputs = [
invoker.js,
invoker.source_root,
]
# TODO(ry) source_map should not be involved at this layer. Remove the
# following.
if (defined(invoker.source_map)) {
inputs += [ invoker.source_map ]
}
outputs = [
snapshot_out_bin,
]

View file

@ -12,7 +12,6 @@ namespace deno {} // namespace deno
int main(int argc, char** argv) {
const char* snapshot_out_bin = argv[1];
const char* js_fn = argv[2];
const char* source_map_fn = argv[3]; // Optional.
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
@ -22,12 +21,6 @@ int main(int argc, char** argv) {
std::string js_source;
CHECK(deno::ReadFileToString(js_fn, &js_source));
std::string source_map;
if (source_map_fn != nullptr) {
CHECK_EQ(argc, 4);
CHECK(deno::ReadFileToString(source_map_fn, &source_map));
}
deno_init();
deno_config config = {deno::empty_buf, nullptr};
Deno* d = deno_new_snapshotter(config, js_fn, js_source.c_str());