Hi all,
I need to publish my ionic5 app on my web hosting. For this reason I built with this command:
ionic cordova platform add browser
ionic cordova build browser --prod
I copied the “platforms\browser\www” content into a specific folder of my web hosting and changed the index.html file replacing base href
from
<base href="/">
to
<base href=".">
When I load my app using browser, some css styles not loaded for path reason.
For example:
there is a background image configured in css classis with a relative path
app.scss
.welcome-container {
background-image: url('assets/imgs/main.png');
}
When I load my web page the path has been changed:
.welcome-container {
background-image: url('/assets/imgs/main.png');
}
What is the best practice? How I need to seth path into scss file?
Thanks
1 post - 1 participant