2017-07-04 03:28:56 +00:00
|
|
|
'use strict';
|
|
|
|
process.env.NODE_ENV = 'development';
|
2017-09-14 22:49:15 +00:00
|
|
|
const path = require('path');
|
2017-07-04 03:28:56 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const base = require('./webpack.base');
|
|
|
|
const FriendlyErrors = require('friendly-errors-webpack-plugin');
|
2017-04-12 04:59:58 +00:00
|
|
|
|
2017-09-13 17:56:20 +00:00
|
|
|
base.devtool = process.env.SLOW_BUILD_SPEED
|
|
|
|
? 'source-map'
|
|
|
|
: 'cheap-module-eval-source-map';
|
|
|
|
|
2017-07-04 03:28:56 +00:00
|
|
|
base.module.loaders.push(
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2017-07-14 17:04:08 +00:00
|
|
|
loaders: ['style-loader', 'css-loader']
|
2017-07-04 03:28:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2017-07-14 17:04:08 +00:00
|
|
|
loaders: ['style-loader', 'css-loader', 'sass-loader']
|
2017-07-04 03:28:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
2017-07-14 17:04:08 +00:00
|
|
|
loaders: ['style-loader', 'css-loader', 'less-loader']
|
2017-07-04 03:28:56 +00:00
|
|
|
}
|
|
|
|
);
|
2017-04-14 07:12:20 +00:00
|
|
|
|
2017-04-12 04:59:58 +00:00
|
|
|
base.plugins.push(
|
2017-09-14 22:49:15 +00:00
|
|
|
new webpack.DllReferencePlugin({
|
|
|
|
context: path.join(__dirname, '../common'),
|
|
|
|
manifest: require('../dll/vendor-manifest.json')
|
|
|
|
}),
|
2017-07-04 03:28:56 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('development')
|
|
|
|
}),
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
|
|
new FriendlyErrors()
|
|
|
|
);
|
2017-04-12 04:59:58 +00:00
|
|
|
|
2017-07-04 03:28:56 +00:00
|
|
|
module.exports = base;
|