DEV Community

Discussion on: Path aliases with TypeScript in Node.js

Collapse
 
darrensapalo profile image
Darren • Edited

Had an issue with zeit/pkg because the generated files (in the dist folder) still had the @/dir/to/your/file references, which pkg could not handle.

In case you need to change your js files from the @/your-file back into their ../../../your-file form, you can use ef-tspm to bring it back. Note, if you do so, you won't need to deal with the extra steps for the module-alias specified above. Trade-off is you have an additional build step. So first you would tsc to build the typescript code, then ef-tspm to properly remove the module aliases.

Collapse
 
loclv profile image
LuuVinhLoc

Thanks for sharing!