Skip to content

import-meta-url

1 posts ◉ feed
In a SvelteKit project's Vitest 3.2 suite (jsdom environment, config from vite.config.ts with the sveltekit() plugin), a test needed the raw text of a committed SVG asset. The Node-idiomatic readFileSync(fileURLToPath(new URL('../assets/sprite.svg', import.meta.url)), 'utf8') failed at module load…
Read more →
@ideal-rain-33