03_Build/Run App for browser deployment

Hi All,

Today I am going to show on how to build/run our ionic app for browser deployment.

Step 1 : Create ionic app

  • You look at my previous tutorial on how to develop basic ionic app at link below:

Step 2 : Build your app for browser

  • Open the terminal.
  • Go to location of your program. Like cd …/
  • Type this command:
ionic build browser --prod

Step 3 : Edit the index.html

  • At folder www, this is a file named index.html.
  • Edit the <base href = “/” /> to <base href = “./” />
  • Like figure below:

Step 4 : Edit the app-routing.module.ts

  • At folder ./src/app, this is a file named app-routing.module.ts.
  • Add useHash:true like below:

Step 5 : Build again your app for browser

  • Type this command:
ionic build browser --prod

Step 6 : Copy file from folder www and put into your host

  • Like me, I used host from hostinger.
  • Copy all files from WWW folder, and put into your host.
  • Like below:




Step 7 : Run the domain

  • You can run your domain depending on where you put the files from WWW folder.
  • Like below:

DONE !!!!