#Issues Dynamically Importing Images from Assets Folder

1 messages · Page 1 of 1 (latest)

glossy matrix
#

I have a folder called assets with 40 images I am trying to dynamically load into my component. When I use a variable in the import path it doesnt work but when I use a path without the variable it works. Does anyone know a solution to this?

gleaming elbow
#

import returns a promise, so you can use it directly during render

#

also, because of how esbuild dynamic import paths can't have variables, the dynamic import works to create a chunk but can't import any file