Blame view

public/build/webpack.dev.config.js 816 Bytes
沈志敏 authored
1
const webpack = require('webpack');
陈峰 authored
2 3 4 5
const path = require('path');
const merge = require('webpack-merge');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
ccbikai(👎🏻🍜) authored
6
const devInfo = require('./dev-info.js');
沈志敏 authored
7
let baseConfig = require('./webpack.base.config.js');
沈志敏 authored
8
沈志敏 authored
9
baseConfig = baseConfig('dev');
10
陈峰 authored
11 12 13 14 15
Object.keys(baseConfig.entry).forEach(function(name) {
    baseConfig.entry[name] = [path.join(__dirname, './dev-client.js')].concat(baseConfig.entry[name]);
});

module.exports = merge(baseConfig, {
16
    output: {
ccbikai(👎🏻🍜) authored
17
        publicPath: devInfo.publicPath
18
    },
毕凯 authored
19
    devtool: 'source-map',
20
    plugins: [
陈峰 authored
21 22
        new ExtractTextPlugin('[name].css'),
        new webpack.HotModuleReplacementPlugin(),
毕凯 authored
23
        new FriendlyErrorsPlugin()
24 25
    ]
});