Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi

if (resolved) {
if (/\.d\.[cm]?ts/.test(resolved.extension)) return null;
if (!filter(resolved.resolvedFileName)) return null;
return path.normalize(resolved.resolvedFileName);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/typescript/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,8 @@ test.serial('does it fail for filtering with incorrect rootDir in nested project
plugins: [typescript({ tsconfig: 'tsconfig.json' })]
})
);
// Will throw parse error because it includes a typescript file outside CWD
t.is(error.code, 'PARSE_ERROR');
// It imports a typescript file outside CWD, hence will not get resolved
t.is(error.code, 'UNRESOLVED_IMPORT');
});

test.serial('does manually setting filterRoot resolve nested projects', async (t) => {
Expand Down