mirror of
https://github.com/denoland/deno.git
synced 2025-07-23 05:05:08 +00:00
Reland "Create an old program to be used in snapshot." (#3747)
* read CLI assets from disk during snapshotting
This commit is contained in:
parent
3c47718959
commit
bd9561f4de
15 changed files with 126 additions and 64 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue