Improve Build Speed (#188)
* 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
This commit is contained in:
parent
f3b85b2aae
commit
a5f2c5e2e9
|
@ -29,12 +29,6 @@ module.exports = {
|
|||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
enforce: 'pre',
|
||||
loaders: ['eslint-loader'],
|
||||
exclude: [/node_modules/]
|
||||
},
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
loaders: ['babel-loader'],
|
||||
|
|
|
@ -5,7 +5,10 @@ const webpack = require('webpack');
|
|||
const base = require('./webpack.base');
|
||||
const FriendlyErrors = require('friendly-errors-webpack-plugin');
|
||||
|
||||
base.devtool = 'source-map';
|
||||
base.devtool = process.env.SLOW_BUILD_SPEED
|
||||
? 'source-map'
|
||||
: 'cheap-module-eval-source-map';
|
||||
|
||||
base.module.loaders.push(
|
||||
{
|
||||
test: /\.css$/,
|
||||
|
|
|
@ -11,9 +11,9 @@ const rimraf = require('rimraf');
|
|||
const distFolder = 'dist/';
|
||||
|
||||
// Clear out build folder
|
||||
rimraf.sync(distFolder, {'rmdirSync': true});
|
||||
rimraf.sync(distFolder, { rmdirSync: true });
|
||||
|
||||
base.devtool = 'cheap-source-map';
|
||||
base.devtool = 'source-map';
|
||||
base.module.loaders.push(
|
||||
{
|
||||
test: /\.css$/,
|
||||
|
|
Loading…
Reference in New Issue