snowberb – 08-55 Jul 4
Is it possible to use variables while importing a module?
I'm trying to dynamically import some module files but when I use variables it doesnt find the file
Works:
Doesn't work:
7 Replies
depends on your bundler, see https://vitejs.dev/guide/features#dynamic-import
yeah we are not using vite
mhm, I get it but I literally have no idea about webpack :nervous:
it's what we are using but idk how versions work here or whatever
thanks for the info tho
I knew i could do this because I did it in other projects which used more modern versions of vite and webpack
if you put the imports in your map it may work better
true! that works wonders
thanks for the idea man
This thread hasn’t had any activity in 36 hours, so it’s now locked.
Threads are closed automatically after 36 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1258345538378666034