- fix for declarations for type only imports on watch

#163
This commit is contained in:
Eugene Zolenko 2019-07-26 11:36:19 -06:00
parent c123ca9841
commit e60eb417d4
7 changed files with 28 additions and 1088 deletions

2
dist/index.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAgV7C,CAAC;AAEF,eAAe,UAAU,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAsV7C,CAAC;AAEF,eAAe,UAAU,CAAC"}

View File

@ -26773,6 +26773,10 @@ const typescript = (options) => {
cache().clean();
return config;
},
watchChange(id) {
const key = normalize(id);
delete declarations[key];
},
resolveId(importee, importer) {
if (importee === TSLIB)
return "\0" + TSLIB;
@ -26789,7 +26793,7 @@ const typescript = (options) => {
const resolved = pluginOptions.rollupCommonJSResolveHack
? resolve.sync(result.resolvedModule.resolvedFileName)
: result.resolvedModule.resolvedFileName;
context.debug(() => `${safe_5("resolving")} '${importee}'`);
context.debug(() => `${safe_5("resolving")} '${importee}' imported by '${importer}'`);
context.debug(() => ` to '${resolved}'`);
return resolved;
}

File diff suppressed because one or more lines are too long

View File

@ -26769,6 +26769,10 @@ const typescript = (options) => {
cache().clean();
return config;
},
watchChange(id) {
const key = normalize(id);
delete declarations[key];
},
resolveId(importee, importer) {
if (importee === TSLIB)
return "\0" + TSLIB;
@ -26785,7 +26789,7 @@ const typescript = (options) => {
const resolved = pluginOptions.rollupCommonJSResolveHack
? sync(result.resolvedModule.resolvedFileName)
: result.resolvedModule.resolvedFileName;
context.debug(() => `${safe_5("resolving")} '${importee}'`);
context.debug(() => `${safe_5("resolving")} '${importee}' imported by '${importer}'`);
context.debug(() => ` to '${resolved}'`);
return resolved;
}

File diff suppressed because one or more lines are too long

1090
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -115,6 +115,12 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
return config;
},
watchChange(id: string)
{
const key = normalize(id);
delete declarations[key];
},
resolveId(this: PluginContext, importee: string, importer: string | undefined)
{
if (importee === TSLIB)
@ -140,7 +146,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
? resolve.sync(result.resolvedModule.resolvedFileName)
: result.resolvedModule.resolvedFileName;
context.debug(() => `${blue("resolving")} '${importee}'`);
context.debug(() => `${blue("resolving")} '${importee}' imported by '${importer}'`);
context.debug(() => ` to '${resolved}'`);
return resolved;