diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2018-09-24 21:33:50 +0200 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-24 15:33:50 -0400 |
| commit | 3fe4be07ca19b40a2444b714f5927ff155d66fed (patch) | |
| tree | ec30d7f4a8f5014917058de8aebf50031bdca796 /js/compiler.ts | |
| parent | 17a7b03d1b86b3519e611aa855f561352075a954 (diff) | |
Add flag --recompile (#801)
Diffstat (limited to 'js/compiler.ts')
| -rw-r--r-- | js/compiler.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/compiler.ts b/js/compiler.ts index 624aab201..f0f82ffb1 100644 --- a/js/compiler.ts +++ b/js/compiler.ts @@ -169,6 +169,8 @@ export class DenoCompiler // A reference to the global scope so it can be monkey patched during // testing private _window = window; + // Flags forcing recompilation of TS code + public recompile = false; /** * Drain the run queue, retrieving the arguments for the module @@ -412,11 +414,15 @@ export class DenoCompiler /** * Retrieve the output of the TypeScript compiler for a given module and - * cache the result. + * cache the result. Re-compilation can be forced using '--recompile' flag. */ compile(moduleMetaData: ModuleMetaData): OutputCode { - this._log("compiler.compile", moduleMetaData.fileName); - if (moduleMetaData.outputCode) { + const recompile = !!this.recompile; + this._log( + "compiler.compile", + { filename: moduleMetaData.fileName, recompile } + ); + if (!recompile && moduleMetaData.outputCode) { return moduleMetaData.outputCode; } const { fileName, sourceCode } = moduleMetaData; |
