webpack.dev.config.js 1009 Bytes
'use strict';

const path = require('path');
const _ = require('lodash');
const webpack = require('webpack');
const devInfo = require('./dev-info.js');
let baseConfig = require('./webpack.base.config.js');

baseConfig = baseConfig('dev');

_.mergeWith(baseConfig, {
    devtool: '#inline-source-map',
    output: {
        publicPath: devInfo.publicPath
    },
    devServer: {
        host: devInfo.host,
        port: devInfo.port,
        publicPath: devInfo.publicPath,
        contentBase: [path.join(__dirname, '../public/bundle/'), path.join(__dirname, '../public')],
        compress: true,
        stats: {
            colors: true,
            children: false,
            chunks: false,
            assetsSort: 'size',
        },
        headers: {
            'Access-Control-Allow-Origin': '*'
        }
    }
}, function customizer(objValue, srcValue) {
    if (_.isArray(objValue)) {
        return objValue.concat(srcValue);
    }
});

delete baseConfig.extends;

module.exports = baseConfig;