joonhocho / tscpaths

Replace absolute paths to relative paths after typescript compilation
MIT License
265 stars 50 forks source link

Not able to replace image assets #17

Open mankittens opened 4 years ago

mankittens commented 4 years ago

I've been running this over some image assets that are aliased and getting back "could not replace". When this line executes with a .ts file, it looks like the path is getting combined with the file name to get the full location. But when it executes with a .png file, only the image file name comes back.

https://github.com/joonhocho/tscpaths/blob/99622e98149f138af7b29f2b3c5ce7a7fcc3ddf8/src/index.ts#L114

I wonder if something as simple as path + filename would suffice here, rather than using the resolve function.