diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-11-14 05:31:39 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-14 08:31:39 -0500 |
commit | 4189cc1ab5493ab0aef48c06416c4d16f6806245 (patch) | |
tree | dad82896518ed93548a8d11b7bf68ad6a0eaa4f0 /cli/global_state.rs | |
parent | fdf0ede2acd110ba04857d5674db19c908b3ff32 (diff) |
Loader: support .wasm imports (#3328)
* loader: support .wasm imports
* http_server: true
* Support named exports
* Clippy
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r-- | cli/global_state.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs index 3e102cb4e..b0c282170 100644 --- a/cli/global_state.rs +++ b/cli/global_state.rs @@ -3,6 +3,7 @@ use crate::compilers::CompiledModule; use crate::compilers::JsCompiler; use crate::compilers::JsonCompiler; use crate::compilers::TsCompiler; +use crate::compilers::WasmCompiler; use crate::deno_dir; use crate::deno_error::permission_denied; use crate::file_fetcher::SourceFileFetcher; @@ -45,6 +46,7 @@ pub struct GlobalState { pub js_compiler: JsCompiler, pub json_compiler: JsonCompiler, pub ts_compiler: TsCompiler, + pub wasm_compiler: WasmCompiler, pub lockfile: Option<Mutex<Lockfile>>, } @@ -111,6 +113,7 @@ impl ThreadSafeGlobalState { ts_compiler, js_compiler: JsCompiler {}, json_compiler: JsonCompiler {}, + wasm_compiler: WasmCompiler::default(), lockfile, }; @@ -130,6 +133,9 @@ impl ThreadSafeGlobalState { .and_then(move |out| match out.media_type { msg::MediaType::Unknown => state1.js_compiler.compile_async(&out), msg::MediaType::Json => state1.json_compiler.compile_async(&out), + msg::MediaType::Wasm => { + state1.wasm_compiler.compile_async(state1.clone(), &out) + } msg::MediaType::TypeScript | msg::MediaType::TSX | msg::MediaType::JSX => { |