Chapter 13. Progressive Web Apps

Since Ionic apps are built with web technologies, you might be wondering if they can be deployed as a traditional web app viewable via a standard browser. The simple answer is yes. That is what we have been doing while we were building and testing our application with $ ionic serve. You can certainly take the contents of the www directory and place them on your web server. The main caveat is that none of the Cordova plugins will function in this environment. The best way to think about publishing your application this way is to think of it as a completely new platform: the browser.

While we don’t have the same capabilities that a native application might have, today’s modern browsers do support several key features, such as geolocation, notifications, and offline storage.

One of the challenges in delivering your application in this manner is the overall file size of our Ionic application. The main.js file that is generated by the CLI (using $ ionic build --prod), starts just under 2 MB.

Reducing Future Build Sizes

The Ionic team is actively working with Angular to reduce the file size of the application further.

Then start factoring in all your visual assets and any other resources you might need very quickly, your app will probably run very slowly as all these items are each fetched across the network. Compound this if you are running over a cellular network or a weak WiFi connection.

However, there is a new idea that is gaining a lot of traction ...

Get Mobile App Development with Ionic 2, 1st Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.