mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
- disabling cache in watch mode (#452)
This commit is contained in:
parent
59817c4ef6
commit
f8613507cb
@ -166,7 +166,10 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
|
||||
service = tsModule.createLanguageService(servicesHost, documentRegistry);
|
||||
servicesHost.setLanguageService(service);
|
||||
|
||||
cache = new TsCache(pluginOptions.clean, pluginOptions.objectHashIgnoreUnknownHack, servicesHost, pluginOptions.cacheRoot, parsedConfig.options, rollupOptions, parsedConfig.fileNames, context);
|
||||
const runClean = pluginOptions.clean;
|
||||
const noCache = pluginOptions.clean || watchMode;
|
||||
|
||||
cache = new TsCache(noCache, runClean, pluginOptions.objectHashIgnoreUnknownHack, servicesHost, pluginOptions.cacheRoot, parsedConfig.options, rollupOptions, parsedConfig.fileNames, context);
|
||||
|
||||
// reset transformedFiles Set on each watch cycle
|
||||
transformedFiles = new Set<string>();
|
||||
|
||||
@ -78,16 +78,16 @@ export class TsCache
|
||||
private syntacticDiagnosticsCache!: ICache<IDiagnostics[]>;
|
||||
private hashOptions = { algorithm: "sha1", ignoreUnknown: false };
|
||||
|
||||
constructor(private noCache: boolean, hashIgnoreUnknown: boolean, private host: tsTypes.LanguageServiceHost, private cacheRoot: string, private options: tsTypes.CompilerOptions, private rollupConfig: any, rootFilenames: string[], private context: RollupContext)
|
||||
constructor(private noCache: boolean, runClean: boolean, hashIgnoreUnknown: boolean, private host: tsTypes.LanguageServiceHost, private cacheRoot: string, private options: tsTypes.CompilerOptions, private rollupConfig: any, rootFilenames: string[], private context: RollupContext)
|
||||
{
|
||||
this.dependencyTree = new Graph({ directed: true });
|
||||
this.dependencyTree.setDefaultNodeLabel((_node: string) => ({ dirty: false }));
|
||||
|
||||
if (noCache)
|
||||
{
|
||||
if (runClean)
|
||||
this.clean();
|
||||
|
||||
if (noCache)
|
||||
return;
|
||||
}
|
||||
|
||||
this.hashOptions.ignoreUnknown = hashIgnoreUnknown;
|
||||
this.cacheDir = `${this.cacheRoot}/${this.cachePrefix}${objHash(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user