ilearnio / module-alias

Register aliases of directories and custom module paths in Node
MIT License
1.76k stars 69 forks source link

[Feature request] Add support for extra extension and also patch path.resolve #67

Open wintercounter opened 5 years ago

wintercounter commented 5 years ago

These are actually 2 separate features.

Kehrlann commented 5 years ago

Hey there !

Just to get a bit more context:

wintercounter commented 5 years ago
ilearnio commented 5 years ago

module-alias works with compiled JS folder rather than TS sources, so it could resolve only .js from dist (or whatever is destination) folder. If you really need to resolve the .ts source path, you should create a separate alias that would point to src folder rather than dist. So even after it's compiled to JS it would still resolve you .ts file

wintercounter commented 5 years ago

I'm using TS in runtime with babel-register so I don't have dist folder, only src.