dividab / tsconfig-paths

Load node modules according to tsconfig paths, in run-time or via API.
MIT License
1.8k stars 100 forks source link

function getPathsToTry does not try to resolve modules starting with a path separator #194

Closed cdpark0530 closed 2 years ago

cdpark0530 commented 2 years ago

I came from this issue: https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/87

I found that getPathsToTry does not resolve modules starts with the path separator of system where it runs, it makes difference in resolution between Windows and Linux. So tsconfig-paths-webpack-plugin does not try to resolve modules starting with / on Linux whereas it does on Windows. (see https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/87#issuecomment-1066303297)

I presume this is intentional, then what is the reason? I don't know recommended arrangements for image modules in css, but image modules kinda oftentimes start with / in projects I'm working on, which I don't see as an exceptional or a special usage in css url function.

Some people like me would need to define aliases starting with / in webpack config as well if this module is not gonna change this issue.

jonaskello commented 2 years ago

I think this may be solved by #180 which was merged yesterday and released in 3.14.0.

Could you try 3.14.0 and see if that solves the problem?

cdpark0530 commented 2 years ago

@jonaskello It works perfectly. I really appreciate your job!