sapcc / juno

Monorepo for the Juno microfrontend framework, microfrontend apps, design system and component library
Apache License 2.0
5 stars 3 forks source link

[Juno] esbuild problem: background image in css file: can't be found 404 #384

Closed andypf closed 1 month ago

andypf commented 10 months ago

d038721 22 days ago (edited) When trying to reference a background image in a separate css file that is imported in the app or a component the resulting path that esbuild generates for the image gives 404: can't be found.

To reproduce:

Create a css file in your app copy some png or svg to your app import the css file in one of your app's components in that component create a div with className test-bg and some text inside so that it gets width and height in the css file create a rule for .test-bg and add background: url(path-to-your-test-image) If you run your app the test div won't have a background image and if you open dev tools and look at the output for the class test-bg the line with the background:... statement should show a 404 for the referenced image.