risen228 / craco-alias

A craco plugin for automatic aliases generation for Webpack and Jest
MIT License
109 stars 11 forks source link

Alias resolution requires duplicate #44

Open eakl opened 2 years ago

eakl commented 2 years ago

Hi

I wonder if this is a bug from craco-alias or typescript.

I would like to type @layout to resolve to ./layout. then adding a forward / would continue the path. e.g. @layout --> ./layout/index.ts @layout/main --> ./layout/main.ts

So in tsconfig.json I did

"paths": {
    "@layout": ["./layout"],
}

But it doesn't work in both case. For the above use case to work, I should add kind of a duplicate


"paths": {
    "@layout": ["./layout"],
    "@layout/*": ["./layout/*"],
}