Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Build for browser platform

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>