diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-01-28 03:12:25 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2020-01-27 21:12:25 -0500 |
commit | ac10d79d231d3b66b918764b9706597321850687 (patch) | |
tree | 6a781c58075ee0c68091e71d2ffd2bb898dc9dfd /cli/compilers/ts.rs | |
parent | f604becaba0c747fdf8dd9d0d744c7bd19322e41 (diff) |
refactor: isomorphic snapshot for CLI (#3728)
Diffstat (limited to 'cli/compilers/ts.rs')
-rw-r--r-- | cli/compilers/ts.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index 9b6661f58..946617fa5 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -160,12 +160,13 @@ fn req( root_names: Vec<String>, compiler_config: CompilerConfig, out_file: Option<String>, + target: &str, bundle: bool, ) -> Buf { let j = match (compiler_config.path, compiler_config.content) { (Some(config_path), Some(config_data)) => json!({ "type": request_type as i32, - "target": "main", + "target": target, "rootNames": root_names, "outFile": out_file, "bundle": bundle, @@ -174,7 +175,7 @@ fn req( }), _ => json!({ "type": request_type as i32, - "target": "main", + "target": target, "rootNames": root_names, "outFile": out_file, "bundle": bundle, @@ -248,9 +249,7 @@ impl TsCompiler { worker_state, ext, ); - worker.execute("bootstrapCompilerRuntime('TS')").unwrap(); - worker.execute("bootstrapWorkerRuntime()").unwrap(); - worker.execute("bootstrapTsCompiler()").unwrap(); + worker.execute("bootstrapTsCompilerRuntime()").unwrap(); worker } @@ -271,6 +270,7 @@ impl TsCompiler { root_names, self.config.clone(), out_file, + "main", true, ); @@ -360,12 +360,15 @@ impl TsCompiler { &source_file.url ); + let target = "main"; + let root_names = vec![module_url.to_string()]; let req_msg = req( msg::CompilerRequestType::Compile, root_names, self.config.clone(), None, + target, false, ); |