Skip to content Skip to sidebar Skip to footer

Webpack -- Include Configuration File As External Resource

As the applicaiton grows, it is time to remove the hard coded things from the code. Time to implement proper configuration file. I am thinking to use webpack, and to include config

Solution 1:

require automatically parses the JSON file. externals expects a string to evaluate, so you'll need to stringify the object:

externals: {
  'Configurator': JSON.stringify(require('./config/config-dev.json'))
},

Post a Comment for "Webpack -- Include Configuration File As External Resource"