Authored by 陈峰

更换js压缩插件支持并行压缩js

... ... @@ -10,6 +10,7 @@ const path = require('path');
const gulp = require('gulp');
const gutil = require('gulp-util');
const ftp = require('gulp-ftp');
const os = require('os');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-sourcemaps');
... ... @@ -19,6 +20,7 @@ const scss = require('postcss-scss');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const UglifyJsParallelPlugin = require('webpack-uglify-parallel');
const webpackConfig = require('./webpack.config.js');
... ... @@ -275,10 +277,8 @@ gulp.task('webpack', ['assets'], (done) => {
'process.env': {
NODE_ENV: '"production"'
}
}), new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}), new UglifyJsParallelPlugin({
workers: os.cpus().length
}));
webpack(proConfig, (err, stats) => {
... ...