Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't skip resolving files imported by other plugins (ezolenko#365)
- previously the `allImportedFiles` Set was _basically_ used to skip any files that were imported by other plugins - it only filtered out on `importer` (not `importee`) - this is a bit of a problem though, as other plugins that create JS code, or `allowJs` JS code, or heck, even regular JS code that Rollup processes without plugins, may actually import TS files - and Rollup's plugin system is designed to handle that scenario, so rpt2 actually _should_ resolve those files - notably, rpt2 already _transforms_ those files, it just didn't resolve them - which is why using `@rollup/plugin-node-resolve` with a `.ts` extension solved this as a workaround - the file would be resolved by `node-resolve` then actually transformed by rpt2 - but rpt2 should resolve TS files itself, `node-resolve` shouldn't be necessary - this caused the issue that extensionless imports from such files wouldn't get resolved to TS files and may cause Rollup to error - in particular, this popped up with extensionless imports of TS files from Svelte files - `resolveId` is actually the last remaining place where `allImportedFiles` was used - so after removing it from here, we can just remove it entirely - which should be a small optimization - for reference: - `allImportedFiles` would be any `include`d files as well as TS files that have been transformed (at this point in the build) and their references - this is a pretty gigantic list as is, so I'm actually not sure that removing this is actually that big of a de-opt - and it only affects mixed TS / non-TS codebases too - this seems to have been added in b0a0ecb, but that commit doesn't actually seem to fix the issue it references - see my root cause analyses in the issues
- Loading branch information