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
Right now I'm facing some problems when bundling my app with parcel, I'm a newbie dev, but I'm think I'm no doing anything wrong.
I am lazy loading images with (vanilla) JS, and at same time, using tag in html, so if the browser don't support webp it loads jpg and vice-versa. On the script side, it gets srcset attribute from current img, and simply remove "-lazy" from image file name then using this to give a new srcset path to finally load the picture with better quality.
All explained here the errors:
Images that are not used do not enter the final bundling folder, when JS replaces srcset the files are missing
Then I think "oh, it's simple, just put the images that bundling ignored and everything will work...and noh this dont works also.
I'm using element.innerHTML = "some image", with some condition to load a different content inside given element and again having problems when that line is read in the script because the img is not loaded, even when I put the unused image in the dist folder.
I don't think solutions like "change back names in your html and script back to their original" are viable, imagine a project with hundreds of images and different functions and methods manipulating these img src...is there any option in parcel to dont change file names?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Right now I'm facing some problems when bundling my app with parcel, I'm a newbie dev, but I'm think I'm no doing anything wrong.
I am lazy loading images with (vanilla) JS, and at same time, using tag in html, so if the browser don't support webp it loads jpg and vice-versa. On the script side, it gets srcset attribute from current img, and simply remove "-lazy" from image file name then using this to give a new srcset path to finally load the picture with better quality.
All explained here the errors:
I don't think solutions like "change back names in your html and script back to their original" are viable, imagine a project with hundreds of images and different functions and methods manipulating these img src...is there any option in parcel to dont change file names?
Beta Was this translation helpful? Give feedback.
All reactions