Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic - build/run for browser

I have a ionic app (current version) that I have built and its now running on my local dev server just fine. I needed to add Strip Payment integration so I included the cordova-stripe-plugin (https://github.com/zyra/cordova-plugin-stripe#module_stripe). I can not test because ionic serve doesn't include the cordova.js, etc. I have looked high and low and can not find any definitive information or guide on how to run/build this app for mobile browser/web/PWA. There is conflicting information. Can you please clarify and provide the command lines to run to build/run and Ionic app that I can deploy to my webserver. Also, what about testing? will I have to rebuild every time I need to make a change or is there a some sort of live reload I can use? Thanks for your help.

like image 953
detourOfReason Avatar asked Jun 19 '17 22:06

detourOfReason


2 Answers

Build for Browser

ionic cordova platform add browser
ionic cordova build browser --prod

For testing on browser just use ionic serve, every time you update code, it will auto rebuild.

like image 110
Nguyen Huynh Avatar answered Oct 24 '22 21:10

Nguyen Huynh


To build app,

ionic cordova build browser

To run app,

ionic cordova run browser

Before run/build run this command on your terminal.

npm serve

If you are working with a git repository please make sure to get pulls before you start coding and before you commit your code.

like image 38
Deshani Vimukthika Avatar answered Oct 24 '22 21:10

Deshani Vimukthika