This commit is contained in:
syuilo 2017-05-24 15:10:00 +09:00
parent ceebb84272
commit 5620ae7384
3 changed files with 6 additions and 2 deletions

View File

@ -87,6 +87,7 @@
"tslint": "5.3.2", "tslint": "5.3.2",
"uglify-es": "3.0.11", "uglify-es": "3.0.11",
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony",
"uglifyjs-webpack-plugin": "0.4.3",
"webpack": "2.6.0" "webpack": "2.6.0"
}, },
"dependencies": { "dependencies": {

View File

@ -1,7 +1,7 @@
import * as webpack from 'webpack';
const StringReplacePlugin = require('string-replace-webpack-plugin'); const StringReplacePlugin = require('string-replace-webpack-plugin');
import constant from './const'; import constant from './const';
import minify from './minify';
const env = process.env.NODE_ENV; const env = process.env.NODE_ENV;
const isProduction = env === 'production'; const isProduction = env === 'production';
@ -13,7 +13,7 @@ export default () => {
]; ];
if (isProduction) { if (isProduction) {
plugins.push(new webpack.optimize.UglifyJsPlugin()); plugins.push(minify());
} }
return plugins; return plugins;

View File

@ -0,0 +1,3 @@
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
export default () => new UglifyJSPlugin();