What is the recommended way to build production apps today?

If you want a cordova app production build, skip this and read @dtslvr’s comment below.
If you want a PWA production build, read on:

In your package.json file, you should have something like this:

"scripts": {
     // ...
     "build:www": "rm -rf www && ionic-app-scripts build --prod",
     // ...
},

Now in your terminal run:

npm run build:www

You are done. This will enable production mode in angular2 with tree-shaking, AoT, etc and build your app in the folder www ready for you to serve in production.


Valid as of ionic2-rc5.
Get more detailed info on the available ionic scripts and what they do over here.

7 Likes