Kin
Kin

Reputation: 5

How to make Ionic 4 build for a browser?

I’m unfortunately having difficulty deploying my ionic project for web. No matter what I do, commands such as 'ionic build, ‘ionic build --prod’, ‘ng build --prod’, or whatsoever always create a www folder that is incorrect. The index.html in this www folder is always blank when viewed from a browser.

I’ve tested this issue on other ionic projects as well (just generated some from templates) and the same issue occurs here, with the index.html in the www folder always being displaying a blank site. If possible, I’d appreciate any help if that’s OK!

Upvotes: 0

Views: 1295

Answers (2)

Manuel Neto
Manuel Neto

Reputation: 11

have you changed the base href in index.html from

base href="/" to

base href="."

Upvotes: 1

Kevin Jose
Kevin Jose

Reputation: 876

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

For testing purpose use ionic serve . It will rebuild automatically every time when you update your code.

Upvotes: 1

Related Questions