diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-06-26 20:28:56 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-06-26 20:28:56 -0400 |
| commit | a5f2930e6a905db00271978d948bf0d1cc1ea65c (patch) | |
| tree | 7ccc9b941287ff0890ec12e466bbfdc64626735c /hooks/after_prepare/uglify.js | |
| parent | 2c837a6adbbdbb5f062e1ad86c98738084d31fb2 (diff) | |
Uglify/minify modified so it kicks in only when --release is used. Also dropping console.log in release mode
Diffstat (limited to 'hooks/after_prepare/uglify.js')
| -rwxr-xr-x | hooks/after_prepare/uglify.js | 6 |
1 files changed, 3 insertions, 3 deletions
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 }); |
