问题
I am getting ready to release my first app build in ionic. I am interested in how I can minify and uglify my code? Are there any plugins for that?
Thanks
uksz
回答1:
There is an automated task runner for JavaScript called Gulp ( gulp.js ). It has packages like:
- gulp-minify-css and gulp-uglify
Hope it helps.
回答2:
Running ionic build --prod
did the trick for me. I am using ionic to deploy my app as a website.
回答3:
Using ionic cordova build <platform> --prod --release
will create you a release version of the app with the code uglyfied and minified.
Also running a simple ionic cordova build <platform>
will also do the job. The minified and uglyfied js is located on the www
folder as main.js
Take in count that what minifies and uglyfies the source code is ionic-app-scripts
.
来源:https://stackoverflow.com/questions/33674158/ionic-how-to-uglify-and-minify-my-code-before-release