Building for android changes image paths in CSS files


#1

Hello there!

I’ve been wondering about why a background image I was trying to use didn’t show up, so I put a <img> tag with the exact same path - this worked perfectly fine. After debugging a little I found this:

GET file:///android_asset/www/build/assets/imgs/background_main.jpg net::ERR_FILE_NOT_FOUND

While the correct path would be: file:///android_asset/www/assets/imgs/background_main.jpg as in the working image tag.

This /build/ part in the URL gets added by either the compiler or the linter, it’s not in my .scss file: background: url("assets/imgs/background_main.jpg")

How do I prevent the compiler from changing this?

Edit: I’ve tried some different combinations as well such as ./assets/imgs/... and imgs/... but it always gets changed to .../build/assets/...


#2

Oh wow nevermind, I may or may not be a little bit dumb. Adding ../ to the url in my css worked.


#3

You may :wink:

The generated CSS is in a different folder, so other paths apply.