webpack.config.js
function buildConfig( wantedEnv )
{

    const isValid = wantedEnv &&
        wantedEnv.length > 0 && allowedEnvs.indexOf( wantedEnv ) !== -1;
    const validEnv = isValid ? wantedEnv : 'dev';

    return configs[ validEnv ];
}
function buildConfig( wantedEnv )
{

    const isValid = wantedEnv &&
        wantedEnv.length > 0 && allowedEnvs.indexOf( wantedEnv ) !== -1;
    const validEnv = isValid ? wantedEnv : 'dev';

    return configs[ validEnv ];
}
function buildConfig ( wantedEnv ) { const isValid = wantedEnv && wantedEnv . length > 0 && allowedEnvs . indexOf ( wantedEnv ) !== - 1 ; const validEnv = isValid ? wantedEnv : 'dev' ; return configs [ validEnv ] ; }
Build the webpack configuration
@param  {String} wantedEnv The wanted environment
@return {Object} Webpack config
Build the webpack configuration