Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Image paths in CSS not transformed during build #5

Open
rondonjon opened this issue May 22, 2020 · 3 comments
Open

Image paths in CSS not transformed during build #5

rondonjon opened this issue May 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@rondonjon
Copy link

rondonjon commented May 22, 2020

Image paths in CSS in .svelte files aren't properly transformed durings builds with this template.

To reproduce:

  • create folder src/images
  • create file src/images/test.png
  • add background: url(./images/test.png); to h1 in src/index.svelte

Expected result:

  • image should be copied to dist folder and have a hash in the filename
  • image path inside the generated bundle should point to the file inside the dist folder
  • h1 on the generated page shows the CSS background image

Actual result:

  • image is copied to dist, where the filename is extended with a hash ✔️
  • image path inside the bundle is still images/test.png
  • CSS background image on h1 is missing ❌
@rondonjon
Copy link
Author

PS: I just noticed that there is in fact a transformed version of the path inside the bundled application, but apparently it gets overwritten by a copy of the original source code which gets inlined. Any ideas?

styles

@rondonjon
Copy link
Author

@dafn
Copy link
Owner

dafn commented May 31, 2020

I'll see what I can do.. seems like it indeed is a problem with parcel and parcel-plugin-svelte

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants