This repository has been archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When running `ionic serve` it often happens that the transpiled files become out of date. After making a change to one of the TypeScript source files, ionic serve runs, but when looking at the built JavaScript files, the new code is not present. I found that the app-scripts build process kept two file caches. One in the app-script context and one in the so called InMemoryCompilerHost. The first was updated, but the latter wasn't. Since the HybridFileSystem already uses the app-scripts context fileCache, I think it is not necassary to also have an InMemoryCompilerHost to keep the same files in memory (and not update them when they were changed). So aside from fixing the out-of-date-files issue, this also will reduce memory usage.
- Loading branch information
1 parent
82fcb6f
commit f3ff455
Showing
4 changed files
with
11 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { CompilerOptions } from 'typescript'; | ||
import { InMemoryCompilerHost } from './compiler-host'; | ||
import { FileSystemCompilerHost } from './compiler-host'; | ||
import { getInstance as getFileSystemInstance } from '../util/hybrid-file-system-factory'; | ||
|
||
let instance: InMemoryCompilerHost = null; | ||
let instance: FileSystemCompilerHost = null; | ||
|
||
export function getInMemoryCompilerHostInstance(options: CompilerOptions) { | ||
export function getFileSystemCompilerHostInstance(options: CompilerOptions) { | ||
if (!instance) { | ||
instance = new InMemoryCompilerHost(options, getFileSystemInstance(false)); | ||
instance = new FileSystemCompilerHost(options, getFileSystemInstance(false)); | ||
} | ||
return instance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters