score:0

Accepted answer

you can create one file config with keys for example "default" and "production". once import with file, check process.env and return actual config object.

const config = require('./data/config.json');

function getconfig() {
   let customconfig = config['default'];

    if (process.env.node_env === 'production') {
        customconfig = config['production'];
    }  

    return customconfig;  
}

score:1

another idea - add to your wabpack alias

 resolve: {
     alias: {
       'config/data': path.resolve(__dirname, `./data/${process.env.node_env}`)
     }
 }

and call it from component this way:

import { data } from 'config/data';


Related Query

More Query from same tag