From f7455c964c49498f6aa1aea1e8ce151a25fc3091 Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Thu, 19 Jan 2017 15:19:24 +0200 Subject: [PATCH] Set minimize=true to loader options when --uglify passed. --- webpack.common.js.angular.template | 4 ++++ webpack.common.js.nativescript.template | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/webpack.common.js.angular.template b/webpack.common.js.angular.template index 725c4c1f..c572205b 100644 --- a/webpack.common.js.angular.template +++ b/webpack.common.js.angular.template @@ -60,6 +60,10 @@ module.exports = function (platform, destinationApp) { ]; if (process.env.npm_config_uglify) { + plugins.push(new webpack.LoaderOptionsPlugin({ + minimize: true + })); + //Work around an Android issue by setting compress = false var compress = platform !== "android"; plugins.push(new webpack.optimize.UglifyJsPlugin({ diff --git a/webpack.common.js.nativescript.template b/webpack.common.js.nativescript.template index be887e3b..903bc004 100644 --- a/webpack.common.js.nativescript.template +++ b/webpack.common.js.nativescript.template @@ -47,6 +47,10 @@ module.exports = function (platform, destinationApp) { ]; if (process.env.npm_config_uglify) { + plugins.push(new webpack.LoaderOptionsPlugin({ + minimize: true + })); + //Work around an Android issue by setting compress = false var compress = platform !== "android"; plugins.push(new webpack.optimize.UglifyJsPlugin({