Skip to content

Commit

Permalink
use babel-minify-webpack-plugin minify code
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Aug 24, 2017
1 parent 8d09632 commit 7768f3c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#
dist/
release/
package-lock.json

# Xcode
#
Expand Down
7 changes: 2 additions & 5 deletions config/webpack.config.electron.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import webpack from 'webpack';
import MinifyPlugin from 'babel-minify-webpack-plugin';
import config from './index';
import baseConfig from './webpack.config.base';

Expand All @@ -21,11 +22,7 @@ export default {

plugins: [
// Minify the output
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
}),
new MinifyPlugin(),

// NODE_ENV should be production so that modules do not perform certain development checks
new webpack.DefinePlugin({
Expand Down
5 changes: 5 additions & 0 deletions config/webpack.config.production.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import path from 'path';
import webpack from 'webpack';
import MinifyPlugin from 'babel-minify-webpack-plugin';
import config from './index';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
Expand All @@ -23,6 +24,10 @@ export default {
},

plugins: [
// https://github.com/webpack/webpack/issues/2545
// Use babel-minify-webpack-plugin minify code
new MinifyPlugin(),

// https://webpack.github.io/docs/list-of-plugins.html#occurrenceorderplugin
// https://github.com/webpack/webpack/issues/864
new webpack.optimize.OccurrenceOrderPlugin(),
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"auto-launch": "^5.0.1",
"axios": "^0.16.2",
"classname": "^0.0.0",
"copy-webpack-plugin": "^4.0.1",
"delegate": "^3.1.3",
"electron-context-menu": "^0.9.1",
"electron-json-storage": "^3.0.6",
Expand All @@ -77,6 +76,7 @@
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.1",
"babel-minify-webpack-plugin": "^0.2.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-react-css-modules": "^3.0.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
Expand All @@ -89,9 +89,11 @@
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"concurrently": "^3.5.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
"electron": "^1.6.11",
"electron-builder": "^19.24.1",
"eslint": "^4.1.1",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
Expand All @@ -102,8 +104,9 @@
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-standard": "^3.0.1",
"express": "^4.15.3",
"electron-builder": "^19.24.1",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"html-webpack-plugin": "^2.30.1",
"json-loader": "^0.5.4",
"postcss-autoreset": "^2.0.0",
"postcss-cssnext": "^2.11.0",
Expand All @@ -115,8 +118,6 @@
"stylelint-config-standard": "^17.0.0",
"url-loader": "^0.5.9",
"webpack": "^3.0.0",
"html-webpack-plugin": "^2.30.1",
"extract-text-webpack-plugin": "^3.0.0",
"webpack-dev-middleware": "^1.11.0",
"webpack-hot-middleware": "^2.18.0"
}
Expand Down

0 comments on commit 7768f3c

Please sign in to comment.