You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As referenced in #541 and #1456, I believe background-image styles defined inline in HTML should be parsed and the images should be treated as assets by Parcel (please correct me if I've misunderstood).
In my test case, this isn't working. The image URLs are left untouched and the images themselves never show up in the dist folder. Doesn't matter if there are quotes around the URLs or not.
In the HTML code provided below, the image URLs should be parsed by Parcel and relevant asset processes run on them.
馃槸 Current Behavior
Nothing happens. The URLs are left untouched and the images never show up in the dist folder. No errors show in the terminal running the Parcel process or the browser console.
Other images defined elsewhere using <img>do get processed correctly. Just not the ones using background-image
馃敠 Context
I'm building a single page web site that uses an image slideshow for part of the content. This slideshow is not used on desktop, only mobile - so if I embedded the images directly in the code using <img> they would be downloaded on mobile devices, wasting time and bandwidth. If I load them using a CSS background-image, I can control the loading somewhat.
Ideally, I'd like to take this even further by defining the images in a data-image-url="..." attribute and load them onto the page completely using Javascript, but I understand if Parcel is limited to parsing the standard attributes that reference images like src and background-image.
It has been implemented a lil while back, it's currently staged for the next release. (You can link the master branch if you really wanna use this or clone and yarn/npm link this)
Release date to be determined.
馃悰 bug report
As referenced in #541 and #1456, I believe background-image styles defined inline in HTML should be parsed and the images should be treated as assets by Parcel (please correct me if I've misunderstood).
In my test case, this isn't working. The image URLs are left untouched and the images themselves never show up in the
dist
folder. Doesn't matter if there are quotes around the URLs or not.馃帥 Configuration (.babelrc, package.json, cli command)
馃 Expected Behavior
In the HTML code provided below, the image URLs should be parsed by Parcel and relevant asset processes run on them.
馃槸 Current Behavior
Nothing happens. The URLs are left untouched and the images never show up in the
dist
folder. No errors show in the terminal running the Parcel process or the browser console.Other images defined elsewhere using
<img>
do get processed correctly. Just not the ones usingbackground-image
馃敠 Context
I'm building a single page web site that uses an image slideshow for part of the content. This slideshow is not used on desktop, only mobile - so if I embedded the images directly in the code using
<img>
they would be downloaded on mobile devices, wasting time and bandwidth. If I load them using a CSS background-image, I can control the loading somewhat.Ideally, I'd like to take this even further by defining the images in a
data-image-url="..."
attribute and load them onto the page completely using Javascript, but I understand if Parcel is limited to parsing the standard attributes that reference images likesrc
andbackground-image
.馃捇 Code Sample
馃實 Your Environment
The text was updated successfully, but these errors were encountered: