I have a Webpacked TypeScript app that loads a json config file. The project is in its infancy so we don't have a good config store in production yet, so we're storing our config files side-by-side: config.json
and config.dev.json
.
In my TypeScript, I want to be able to type
import Config from './path/to/config.json';
and if --mode development
is passed into webpack, I want it to require ./path/to/config.dev.json
.
Is this possible with just Webpack or Webpack + tsconfig.json?