Skip to content

Commit 4a0c297

Browse files
authored
fix: filter "missed" declarations as well (ezolenko#347)
- these should run through the same `filter` as runs in `transform` etc - prior to this, the plugin `exclude` would filter files in `transform`, meaning no JS would be output for them, but would still output declarations for these very same files that no JS was produced for - (this would only happen if one were using an `include` glob or something that made the file appear twice, i.e. once by Rollup in `transform` and once in `parsedConfig.fileNames`) - this change makes it so the plugin `exclude` affects both JS and DTS output equivalently - it was very confusing when it didn't, and users relied on setting different `tsconfig` `exclude`s to workaround this (as a `tsconfig` `exclude` would make the file not appear in `parsedConfig.fileNames`)
1 parent c0fb53d commit 4a0c297

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
304304
parsedConfig.fileNames.forEach((name) =>
305305
{
306306
const key = normalize(name);
307-
if (key in declarations)
307+
if (key in declarations || !filter(key))
308308
return;
309309

310310
context.debug(() => `generating missed declarations for '${key}'`);

0 commit comments

Comments
 (0)