minify
https://www.npmjs.com/package/ionic-minify
https://github.com/Kurtz1993/ionic-minify/blob/master/lib/IonicMinifyConfigurations.d.ts#L92
https://github.com/Kurtz1993/ionic-minify/blob/master/lib/IonicMinifyConfigurations.d.ts#L92
cnpm install ionic-minify --save-dev
cnpm run ionic:build --prod
package.json
"scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "lint": "ionic-app-scripts lint", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve", "minify": "ionic-app-scripts minify", "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony" },
minify-conf.json
{ "foldersToProcess": [ "js", "css", "img" ], "jpgOptions":{ "quality": 50 }, "jsOptions": { "compress": { "drop_console": true } }, "cssOptions": { "keepSpecialComments": 0 }, "alwaysRun": false, "showErrStack": false}
cnpm install ionic-minify --save-devE:\01.code\git\ionic\myapp>cnpm install ionic-minify --save-dev√ Installed 1 packages√ Linked 234 latest versions √ mozjpeg pre-build test passed successfully √ pngout pre-build test passed successfullyCreating directory: E:\01.code\git\ionic\myapp\hooks\after_prepareCopying minifier file to project's hooks/after_prepare...Copying configuration file to project's hooks/ folder...Updating hooks directory to have execution permissions...It appears that you have already installed chalk...It appears that you have already installed clean-css...It appears that you have already installed mozjpeg-stream...It appears that you have already installed ng-annotate...It appears that you have already installed pngout-bin...It appears that you have already installed shelljs...It appears that you have already installed uglify-js...Ionic minify has been installed successfully! :)√ Run 4 scriptsdeprecate ionic-minify@2.0.10 › pngout-bin@2.0.1 › bin-wrapper@2.1.3 › globby@1.2.0 › glob@4.5.3 › minimatch@^2.0.1 Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issuedeprecate ionic-minify@2.0.10 › pngout-bin@2.0.1 › bin-wrapper@2.1.3 › download@3.3.0 › vinyl-fs@0.3.14 › glob-watcher@0.0.6 › gaze@0.5.2 › globule@0.1.0 › minimatch@~0.2.11 Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issuedeprecate ionic-minify@2.0.10 › pngout-bin@2.0.1 › bin-wrapper@2.1.3 › download@3.3.0 › vinyl-fs@0.3.14 › glob-watcher@0.0.6 › gaze@0.5.2 › globule@0.1.0 › glob@3.1.21 › graceful-fs@~1.2.0 graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.Recently updated (since 2017-07-26): 5 packages (detail see file E:\01.code\git\ionic\myapp\node_modules\.recently_updates.txt) Today: → ionic-minify@2.0.10 › mozjpeg-stream@1.0.2 › mozjpeg@4.1.1 › bin-wrapper@3.0.2 › download@4.4.3 › vinyl-fs@2.4.4 › duplexify@^3.2.0(3.5.1) (04:44:06)√ All packages installed (215 packages installed from npm registry, used 11s, speed 102.92kB/s, json 235(330.75kB), tarball 850.62kB)E:\01.code\git\ionic\myapp>E:\01.code\git\ionic\myapp>E:\01.code\git\ionic\myapp>cnpm run ionic:build --prodE:\01.code\git\ionic\myapp>cnpm run ionic:build --prod> myapp@0.0.1 ionic:build E:\01.code\git\ionic\myapp> ionic-app-scripts build[11:21:09] ionic-app-scripts 2.1.0[11:21:09] build prod started ...[11:21:09] clean started ...[11:21:09] clean finished in less than 1 ms[11:21:09] copy started ...[11:21:09] ngc started ...[11:21:19] ngc finished in 9.71 s[11:21:19] preprocess started ...[11:21:19] deeplinks started ...[11:21:19] deeplinks finished in 344 ms[11:21:19] optimization started ...[11:21:20] copy finished in 10.47 s[11:21:29] optimization finished in 10.37 s[11:21:29] preprocess finished in 10.71 s[11:21:29] webpack started ...[11:21:58] webpack finished in 28.59 s[11:21:58] sass started ...[11:21:58] webpack started ...[11:21:58] uglifyjs started ...[11:22:28] uglifyjs finished in 29.45 s[11:22:28] webpack finished in 29.78 s[11:22:28] sass finished in 29.94 s[11:22:28] cleancss started ...[11:22:29] cleancss finished in 515 ms[11:22:29] postprocess started ...[11:22:29] postprocess finished in 6 ms[11:22:29] lint started ...[11:22:29] build prod finished in 79.51 s