Authored by 陈峰

Merge branch 'master' into release/1.0

@@ -2,6 +2,8 @@ const webpack = require('webpack'); @@ -2,6 +2,8 @@ const webpack = require('webpack');
2 var path = require('path'); 2 var path = require('path');
3 let utils = require('./utils'); 3 let utils = require('./utils');
4 let config = require('./config') 4 let config = require('./config')
  5 +const os = require('os');
  6 +const UglifyJsparallelPlugin = require('webpack-uglify-parallel');
5 const AssetsPlugin = require('assets-webpack-plugin'); 7 const AssetsPlugin = require('assets-webpack-plugin');
6 let ExtractTextPlugin = require('extract-text-webpack-plugin'); 8 let ExtractTextPlugin = require('extract-text-webpack-plugin');
7 9
@@ -62,10 +64,13 @@ module.exports = { @@ -62,10 +64,13 @@ module.exports = {
62 new webpack.DefinePlugin({ 64 new webpack.DefinePlugin({
63 'process.env': config.build.env 65 'process.env': config.build.env
64 }), 66 }),
65 - new webpack.optimize.UglifyJsPlugin({ 67 + new UglifyJsparallelPlugin({
  68 + workers: os.cpus().length,
  69 + mangle: true,
66 compress: { 70 compress: {
67 warnings: false 71 warnings: false
68 }, 72 },
  73 + comments: false,
69 sourceMap: true 74 sourceMap: true
70 }), 75 }),
71 new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), 76 new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 "dev": "nodemon --watch server server/app.js", 7 "dev": "nodemon --watch server server/app.js",
8 "static": "node ./build/dev-server.js", 8 "static": "node ./build/dev-server.js",
9 "dist": "node ./build/build.js", 9 "dist": "node ./build/build.js",
10 - "build": "npm run build:dll && node ./build/build.js", 10 + "build": "npm run build:dll --production && node ./build/build.js",
11 "build:dll": "rimraf build/dll && webpack --config build/webpack.dll.conf.js", 11 "build:dll": "rimraf build/dll && webpack --config build/webpack.dll.conf.js",
12 "lint-js": "eslint --ext .js,.vue -c .eslintrc --cache app server", 12 "lint-js": "eslint --ext .js,.vue -c .eslintrc --cache app server",
13 "lint-css": "stylelint --syntax scss --extract --config .stylelintrc **/*.vue", 13 "lint-css": "stylelint --syntax scss --extract --config .stylelintrc **/*.vue",