From 5620ae7384ac4975def8b1949f39ac48241ae16e Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 May 2017 15:10:00 +0900 Subject: [PATCH] Fix --- package.json | 1 + webpack/plugins/index.ts | 4 ++-- webpack/plugins/minify.ts | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 webpack/plugins/minify.ts diff --git a/package.json b/package.json index cce19e7870..922c1ebc0d 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "tslint": "5.3.2", "uglify-es": "3.0.11", "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", + "uglifyjs-webpack-plugin": "0.4.3", "webpack": "2.6.0" }, "dependencies": { diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index 1f46247eea..cbffbad4e0 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -1,7 +1,7 @@ -import * as webpack from 'webpack'; const StringReplacePlugin = require('string-replace-webpack-plugin'); import constant from './const'; +import minify from './minify'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; @@ -13,7 +13,7 @@ export default () => { ]; if (isProduction) { - plugins.push(new webpack.optimize.UglifyJsPlugin()); + plugins.push(minify()); } return plugins; diff --git a/webpack/plugins/minify.ts b/webpack/plugins/minify.ts new file mode 100644 index 0000000000..78c587afea --- /dev/null +++ b/webpack/plugins/minify.ts @@ -0,0 +1,3 @@ +const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); + +export default () => new UglifyJSPlugin();