webpack-build.js
function mergeDefaultConfig(opts) {

    let devModeEnabled = isDevelopMode();
    let debugModeEnabled = isDebugMode();

    console.log('------------------------------------------------------------------------------------');
    console.log(`Executing build for ` + (devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD));
    console.log('------------------------------------------------------------------------------------');

    let config = {

        metadata: {
            ENV: devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD
        },
        devtool: 'source-map',
        debug: debugModeEnabled,

        entry: {},

        output: {
            filename: devModeEnabled ? '[name].bundle.js' : '[name].[chunkhash].bundle.js',
            sourceMapFilename: devModeEnabled ? '[name].bundle.map' : '[name].[chunkhash].bundle.map',
            chunkFilename: devModeEnabled ? '[id].chunk.js' : '[id].[chunkhash].chunk.js'
        },

        resolve: {
            cache: false,
            extensions: ['', '.ts', '.tsx', '.js', '.json', '.css', '.html']
        },

        module: {
            preLoaders: [],
            loaders: []
        },

        plugins: [],

        // we need this due to problems with es6-shim
        node: {
            global: 'window',
            progress: false,
            crypto: 'empty',
            module: false,
            clearImmediate: false,
            setImmediate: false
        }
    };

    if (debugModeEnabled) {
        console.log(merge(config, opts));
        console.log('------------------------------------------------------------------------------------');
    }

    return merge(config, opts);
}
function mergeDefaultConfig(opts) {

    let devModeEnabled = isDevelopMode();
    let debugModeEnabled = isDebugMode();

    console.log('------------------------------------------------------------------------------------');
    console.log(`Executing build for ` + (devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD));
    console.log('------------------------------------------------------------------------------------');

    let config = {

        metadata: {
            ENV: devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD
        },
        devtool: 'source-map',
        debug: debugModeEnabled,

        entry: {},

        output: {
            filename: devModeEnabled ? '[name].bundle.js' : '[name].[chunkhash].bundle.js',
            sourceMapFilename: devModeEnabled ? '[name].bundle.map' : '[name].[chunkhash].bundle.map',
            chunkFilename: devModeEnabled ? '[id].chunk.js' : '[id].[chunkhash].chunk.js'
        },

        resolve: {
            cache: false,
            extensions: ['', '.ts', '.tsx', '.js', '.json', '.css', '.html']
        },

        module: {
            preLoaders: [],
            loaders: []
        },

        plugins: [],

        // we need this due to problems with es6-shim
        node: {
            global: 'window',
            progress: false,
            crypto: 'empty',
            module: false,
            clearImmediate: false,
            setImmediate: false
        }
    };

    if (debugModeEnabled) {
        console.log(merge(config, opts));
        console.log('------------------------------------------------------------------------------------');
    }

    return merge(config, opts);
}
function mergeDefaultConfig ( opts ) { let devModeEnabled = isDevelopMode ( ) ; let debugModeEnabled = isDebugMode ( ) ; console . log ( '------------------------------------------------------------------------------------' ) ; console . log ( ` ` + ( devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD ) ) ; console . log ( '------------------------------------------------------------------------------------' ) ; let config = { metadata : { ENV : devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD } , devtool : 'source-map' , debug : debugModeEnabled , entry : { } , output : { filename : devModeEnabled ? '[name].bundle.js' : '[name].[chunkhash].bundle.js' , sourceMapFilename : devModeEnabled ? '[name].bundle.map' : '[name].[chunkhash].bundle.map' , chunkFilename : devModeEnabled ? '[id].chunk.js' : '[id].[chunkhash].chunk.js' } , resolve : { cache : false , extensions : [ '' , '.ts' , '.tsx' , '.js' , '.json' , '.css' , '.html' ] } , module : { preLoaders : [ ] , loaders : [ ] } , plugins : [ ] , // we need this due to problems with es6-shim node : { global : 'window' , progress : false , crypto : 'empty' , module : false , clearImmediate : false , setImmediate : false } } ; if ( debugModeEnabled ) { console . log ( merge ( config , opts ) ) ; console . log ( '------------------------------------------------------------------------------------' ) ; } return merge ( config , opts ) ; }
Module defining the common build configuration for webpack-based projects.

@param opts Customized options which allows to override the defaults configuration.
Module defining the common build configuration for webpack - based projects .