summaryrefslogtreecommitdiff
path: root/cli/js/compiler.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-01-22 20:18:01 +0100
committerGitHub <noreply@github.com>2020-01-22 20:18:01 +0100
commitbd9561f4de8f940ce6ed8b5eedfa84161a749c54 (patch)
tree20bc23c294aa3031fe4729dc09e03351ec6097f4 /cli/js/compiler.ts
parent3c47718959fb38d51e34c64d423151b5326bae3a (diff)
Reland "Create an old program to be used in snapshot." (#3747)
* read CLI assets from disk during snapshotting
Diffstat (limited to 'cli/js/compiler.ts')
-rw-r--r--cli/js/compiler.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index 3cebf24b2..54861f713 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -6,6 +6,7 @@ import "./globals.ts";
import "./ts_global.d.ts";
import { TranspileOnlyResult } from "./compiler_api.ts";
+import { oldProgram } from "./compiler_bootstrap.ts";
import { setRootExports } from "./compiler_bundler.ts";
import {
defaultBundlerOptions,
@@ -142,7 +143,12 @@ self.bootstrapTsCompiler = function tsCompilerMain(): void {
// to generate the program and possibly emit it.
if (!diagnostics || (diagnostics && diagnostics.length === 0)) {
const options = host.getCompilationSettings();
- const program = ts.createProgram(rootNames, options, host);
+ const program = ts.createProgram({
+ rootNames,
+ options,
+ host,
+ oldProgram
+ });
diagnostics = ts
.getPreEmitDiagnostics(program)
@@ -220,11 +226,12 @@ self.bootstrapTsCompiler = function tsCompilerMain(): void {
}
host.mergeOptions(...compilerOptions);
- const program = ts.createProgram(
+ const program = ts.createProgram({
rootNames,
- host.getCompilationSettings(),
- host
- );
+ options: host.getCompilationSettings(),
+ host,
+ oldProgram
+ });
if (bundle) {
setRootExports(program, rootNames[0]);