MyCrypto/webpack_config/webpack.dev.js
HenryNguyen5 7a460960d7 Build speed v2 (#195)
* Improve build speed by using cheap source maps and dropping eslint loader.

* use old 'source-map' on dev when SLOW_BUILD_SPEED env variable exists

* Increase build speed further via caching and DLL

* Cleanup code

* Add step to readme

* Move DLL loader to dev instead of base

* Add post install script

* Revert readme change

* ignore dll dir
2017-09-14 15:49:15 -07:00

41 lines
989 B
JavaScript

'use strict';
process.env.NODE_ENV = 'development';
const path = require('path');
const webpack = require('webpack');
const base = require('./webpack.base');
const FriendlyErrors = require('friendly-errors-webpack-plugin');
base.devtool = process.env.SLOW_BUILD_SPEED
? 'source-map'
: 'cheap-module-eval-source-map';
base.module.loaders.push(
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.less$/,
loaders: ['style-loader', 'css-loader', 'less-loader']
}
);
base.plugins.push(
new webpack.DllReferencePlugin({
context: path.join(__dirname, '../common'),
manifest: require('../dll/vendor-manifest.json')
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new FriendlyErrors()
);
module.exports = base;