I have a function in js that gets the image src based on an index. This works fine in dev mode, but after the build the image filenames get hashed and my sources don’t match anymore.
Is there a correct way to reference images in bud?
I use this class already to make my images. Maybe my question isn’t clear. My actual problem is that the image sources are getting hashed by bud. So after building my js, my reference to the source isn’t correct anymore.
As temporary solution I moved the images outside of the theme folder. Now I can reference them by an absolute url.
I am not sure about your use case but I would just add image url inside HTML as data-image attribute or something like this and then read that from the JS code…
Would that work for you ?