From a5f2930e6a905db00271978d948bf0d1cc1ea65c Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Fri, 26 Jun 2015 20:28:56 -0400 Subject: Uglify/minify modified so it kicks in only when --release is used. Also dropping console.log in release mode --- hooks/after_prepare/uglify.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hooks') diff --git a/hooks/after_prepare/uglify.js b/hooks/after_prepare/uglify.js index b90e285f..ecb26faa 100755 --- a/hooks/after_prepare/uglify.js +++ b/hooks/after_prepare/uglify.js @@ -16,8 +16,8 @@ var platform = process.env.CORDOVA_PLATFORMS; var cliCommand = process.env.CORDOVA_CMDLINE; // hook configuration -var isRelease = true; // by default this hook is always enabled, see the line below on how to execute it only for release -//var isRelease = (cliCommand.indexOf('--release') > -1); +//var isRelease = true; // by default this hook is always enabled, see the line below on how to execute it only for release +var isRelease = (cliCommand.indexOf('--release') > -1); var recursiveFolderSearch = true; // set this to false to manually indicate the folders to process var foldersToProcess = [ // add other www folders in here if needed (ex. js/controllers) 'js', @@ -73,7 +73,7 @@ function compress(file) { var res = ngAnnotate(String(fs.readFileSync(file)), { add: true }); var result = UglifyJS.minify(res.src, { compress: { // pass false here if you only want to minify (no obfuscate) - drop_console: false // remove console.* statements (log, warn, etc.) + drop_console: true // remove console.* statements (log, warn, etc.) }, fromString: true }); -- cgit v1.2.3