This might be more of a Vite question, but I can’t seem to find anything online. At the top of the default app.js file we have
import.meta.glob([
'../images/**',
'../fonts/**',
]);
If I want to get an image URL in javascript I have been using import audio_3 from '../audio/3.mp3';
but this throws the warning (!) /app/public/wp-content/themes/skillcheck/resources/audio/3.mp3 is dynamically imported by /app/public/wp-content/themes/skillcheck/resources/js/app.js but also statically imported by /app/public/wp-content/themes/skillcheck/resources/js/app.js, dynamic import will not move module into another chunk.
Is there a better way to get the image URLs from the /build/assets folder?