Build & Serve ionic as a web app


Is there a support for building ionic 2 for web? SO to exclude cordova dependencies and clean for using as website


This is something we’re investigating down the road, making sure Ionic 2 is setup for things like progressive web apps and possible use cordova’s browser platform to ship browser webapps.


What is the timeline for this. We are really looking forward to do that like right now.


We implemented mobile website using Ionic 1. You can look into on mobile web. It’s working fine besides few low priority issues and one major issue: the amount of time it takes for the Ionic bundle to load. Ionic bundle size is ~2.3 MB before compression and it’s causing the page to load relatively slow.


We are looking for Angluar 2, Ionic 2 solution tho. As Angluar2 states that one framework for both mobile and web. So it should work on web app right?


gulp build --release

works for me.


Gulp build? Are you using a special build for Ionic 2 app as Ionic CLI should be ionic build…right?


No, but ionic build itself invokes gulp with the gulpfile, among a number of other things. Unfortunately, it requires a platform argument, and defaults to ‘ios’ if one is not supplied.

I haven’t studied everything else that Ionic CLI does, but gulp build has worked for me for building www (it just bypasses all of the Ionic CLI components). I’d love to hear from an expert whether there is anything wrong with this, and if so, what is the “correct” way to build a non-platform website version.


well, i could do it by
run ionic serve, then it generates a www Directory, which i used to put on my webserver
i tried it with the cordova geolocation plugin, also seems to work…


Hi Yosikal, were you able to optimize the build (minify, uglify, aot etc.)? If so, can you share the steps? Thanks in advance.


So if you upload the www folder to a webserver and you browse it on a mobile phone, native stuff like geolocation and camera work properly?

Sounds very interesting! I’m going to try this ASAP!



I would find that supremely surprising.


It’s been a while since the latest response but I find that this build what I need without launching and killing ionic serve:

ionic cordova build browser --release


ionic cordova build browser --release