Skip to content

Commit

Permalink
fix: filter "missed" declarations as well (#347)
Browse files Browse the repository at this point in the history
- 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`)
  • Loading branch information
agilgur5 authored Jun 7, 2022
1 parent c0fb53d commit 4a0c297
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
parsedConfig.fileNames.forEach((name) =>
{
const key = normalize(name);
if (key in declarations)
if (key in declarations || !filter(key))
return;

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

0 comments on commit 4a0c297

Please sign in to comment.