How to build and deploy an Ionic App for Browser.
(Last Updated On: February 18, 2018) This will work for Ionic 2.x and Ionic 3.x and will make a folder structure ready for deploy.
You need to run (depending on your Ionic Cli version)
ionic cordova build browser --prod
or
ionic build browser --prod
Then you need to use what is inside platforms/browser/www
.
Ad:
Be aware that depending of what your App does, you could need to use a HTTP server to be able to see it locally.
There is also a direct way using npm
npm run ionic:build --prod
how to depoly ionic4?
I haven’t use Ionic 4 (I am waiting for the first official release) but as I understand you now builds the app with the Angular Cli. So you should use
ng build
Please if I am wrong somebody tell me.
Hey, so in ionic 4 with angular, I want to build for browser with cordova enable so i can use cordova camera plugin in browser also, is it good to build for browser from ionic cordova build browser --prod instead of ionic build --prod or ng build --prod what are… Read more »
ionic cordova build browser --prod
sounds like the correct approach. You just have to be sure that the cordova plugin you want to use also supports the browser platform.