score:-1

const config = require('./node/config/prod.js');

module.exports = {
  // skip other setting...

  plugins: [
    new webpack.DefinePlugin({
      'process.env.NODE_ENV' : JSON.stringify('production'),
      'process.env.GTM_ID' : JSON.stringify(config.gtm.id)
    });
  ]
};

score:2

export function getConfig() {
   const req = axios.get('/getconfig')
            .then(res=> res.data)
            .catch(err => console.log(err));
   return {
        type: "GETCONFIG",
        payload: req
   }
}


Related Query

More Query from same tag