dividab / tsconfig-paths-webpack-plugin

Load modules according to tsconfig paths in webpack.
MIT License
598 stars 51 forks source link

configFile ignored if TS_NODE_PROJECT is set #17

Open phryneas opened 6 years ago

phryneas commented 6 years ago

Hi :)

I have an extra tsconfig.json for my webpack configuration that is different from the tsconfig.json that should be used by tsconfig-paths-webpack-plugin.

The way to pass a different config to webpack is by setting TS_NODE_PROJECT - unfortunately that leads to tsconfig-paths-webpack-plugin ignoring the configFile option in favor of the one in the environment variable :/

I guess that the problem itself is somewhere in https://github.com/dividab/tsconfig-paths , but I think it is more a bug with tsconfig-paths-webpack-plugin so I was not really sure where to post this issue, but as you are the maintainer of both projects, I guess this is fine ;)

naruaway commented 6 years ago

I also encountered the same problem. Although putting delete process.env.TS_NODE_PROJECT at the top of webpack.config.ts worked as workaround for me, I think configFile should not be ignored silently :)

VictorQueiroz commented 4 years ago

delete process.env.TS_NODE_PROJECT seems very hacky to me. It seems to be an issue here. Not sure why. Maybe the author's preference. >> https://github.com/dividab/tsconfig-paths/blob/master/src/tsconfig-loader.ts#L37