Skip to content

Commit d0f4eb7

Browse files
authored
fix: another edge case for implicit * path (#43)
closes #42
1 parent b612e30 commit d0f4eb7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const transformer = (_: ts.Program) => (context: ts.TransformationContext) => (
2929

3030
const { isDeclarationFile } = sourceFile;
3131

32-
const { baseUrl = "", paths = { "*": ["*"] } } = compilerOptions;
32+
const { baseUrl = "", paths = {} } = compilerOptions;
33+
paths["*"] = paths["*"]?.concat("*") ?? ["*"];
3334

3435
const binds = Object.keys(paths)
3536
.filter(key => paths[key].length)

tests/__fixtures/without-path/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
"esModuleInterop": true,
1010

11+
"paths": {
12+
"@utils/*": ["utils/*"]
13+
},
14+
1115
"plugins": [
1216
{ "transform": "../../../" },
1317
{ "transform": "../../../", "afterDeclarations": true }

0 commit comments

Comments
 (0)