diff options
Diffstat (limited to 'cli/js/compiler/host.ts')
-rw-r--r-- | cli/js/compiler/host.ts | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cli/js/compiler/host.ts b/cli/js/compiler/host.ts index 70e712ffe..afe184d3e 100644 --- a/cli/js/compiler/host.ts +++ b/cli/js/compiler/host.ts @@ -14,9 +14,8 @@ export enum CompilerHostTarget { export interface CompilerHostOptions { bundle?: boolean; - target: CompilerHostTarget; - + unstable?: boolean; writeFile: WriteFileCallback; } @@ -146,13 +145,26 @@ export class Host implements ts.CompilerHost { /* Deno specific APIs */ - constructor({ bundle = false, target, writeFile }: CompilerHostOptions) { + constructor({ + bundle = false, + target, + unstable, + writeFile, + }: CompilerHostOptions) { this.#target = target; this.#writeFile = writeFile; if (bundle) { // options we need to change when we are generating a bundle Object.assign(this.#options, defaultBundlerOptions); } + if (unstable) { + this.#options.lib = [ + target === CompilerHostTarget.Worker + ? "lib.deno.worker.d.ts" + : "lib.deno.window.d.ts", + "lib.deno.unstable.d.ts", + ]; + } } configure(path: string, configurationText: string): ConfigureResponse { |