We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8accca3 commit 5f23889Copy full SHA for 5f23889
index.ts
@@ -6,7 +6,15 @@ export const resolveTypescriptPaths = (options: Options = {}) => {
6
return {
7
name: 'resolve-typescript-paths',
8
resolveId: (importee: string, importer: string) => {
9
- if (!compilerOptions.paths || !compilerOptions.paths[importee]) {
+ if (!compilerOptions.paths) {
10
+ return null;
11
+ }
12
+
13
+ const hasMatchingPath = Object.keys(compilerOptions.paths).some(path =>
14
+ new RegExp(path.replace('*', '\\w*')).test(importee),
15
+ );
16
17
+ if (!hasMatchingPath) {
18
return null;
19
}
20
0 commit comments