diff options
Diffstat (limited to 'deno_typescript/lib.rs')
-rw-r--r-- | deno_typescript/lib.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/deno_typescript/lib.rs b/deno_typescript/lib.rs index f1b0dd4da..d88932eeb 100644 --- a/deno_typescript/lib.rs +++ b/deno_typescript/lib.rs @@ -25,7 +25,7 @@ use std::sync::Mutex; static TYPESCRIPT_CODE: &str = include_str!("typescript/lib/typescript.js"); static COMPILER_CODE: &str = include_str!("compiler_main.js"); -static BUNDLE_LOADER: &str = include_str!("bundle_loader.js"); +static SYSTEM_LOADER: &str = include_str!("system_loader.js"); pub fn ts_version() -> String { let data = include_str!("typescript/package.json"); @@ -143,20 +143,20 @@ pub fn compile_bundle( let config_json = serde_json::json!({ "compilerOptions": { - "strict": true, "declaration": true, - "lib": ["esnext"], - "module": "amd", - "target": "esnext", - "listFiles": true, - "listEmittedFiles": true, - // "types" : ["typescript.d.ts"], - "typeRoots" : ["$typeRoots$"], // Emit the source alongside the sourcemaps within a single file; // requires --inlineSourceMap or --sourceMap to be set. // "inlineSources": true, - "sourceMap": true, + "lib": ["esnext"], + "listEmittedFiles": true, + "listFiles": true, + "module": "system", "outFile": bundle_filename, + "removeComments": true, + "sourceMap": true, + "strict": true, + "target": "esnext", + "typeRoots" : ["$typeRoots$"], }, }); @@ -198,13 +198,13 @@ pub fn mksnapshot_bundle( bundle_filename: &Path, main_module_name: &str, ) -> Result<(), ErrBox> { - js_check(isolate.execute("bundle_loader.js", BUNDLE_LOADER)); + js_check(isolate.execute("system_loader.js", SYSTEM_LOADER)); let source_code_vec = std::fs::read(bundle_filename).unwrap(); let bundle_source_code = std::str::from_utf8(&source_code_vec).unwrap(); js_check( isolate.execute(&bundle_filename.to_string_lossy(), bundle_source_code), ); - let script = &format!("instantiate('{}')", main_module_name); + let script = &format!("__instantiate(\"{}\");", main_module_name); js_check(isolate.execute("anon", script)); write_snapshot(isolate, snapshot_filename)?; Ok(()) |