Maybe I am missing something but I was not able to get dynamic imports to work.
// This does work. It returns an object with the files I expected.
import sz from "./spacetrash/tiled/*";
console.log(sz)
// this does not work. It returns an empty object.
import("/spacetrash/tiled/*").then((t) => {
console.log(t)
})