From b0fd71c7aef7027389a495ca0b5ff2cea0f85ab3 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 4 Jun 2022 22:55:43 -0400 Subject: [PATCH] fix: filter "missed" declarations as well - 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`) --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f0960108..f9200815 100644 --- a/src/index.ts +++ b/src/index.ts @@ -301,7 +301,7 @@ const typescript: PluginImpl = (options) => parsedConfig.fileNames.forEach((name) => { const key = normalize(name); - if (key in declarations) + if (key in declarations || !filter(key)) return; if (!allImportedFiles.has(key)) {