mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
Merge pull request #5 from bluetech/fix-plugin-chaining
Fix plugin chaining
This commit is contained in:
commit
8ebfc89582
@ -6,6 +6,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost
|
||||
{
|
||||
private cwd = process.cwd();
|
||||
private snapshots: { [fileName: string]: ts.IScriptSnapshot } = {};
|
||||
private versions: { [fileName: string]: number } = {};
|
||||
|
||||
constructor(private parsedConfig: ts.ParsedCommandLine)
|
||||
{
|
||||
@ -15,6 +16,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost
|
||||
{
|
||||
let snapshot = ts.ScriptSnapshot.fromString(data);
|
||||
this.snapshots[fileName] = snapshot;
|
||||
this.versions[fileName] = (this.versions[fileName] || 0) + 1;
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
@ -39,7 +41,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost
|
||||
|
||||
public getScriptVersion(_fileName: string)
|
||||
{
|
||||
return "0";
|
||||
return (this.versions[_fileName] || 0).toString();
|
||||
}
|
||||
|
||||
public getScriptFileNames()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user