I am using astro
framework with svelte
as interactive island.
and I want to use wasm
inside my svelte
island directly to process some [markdown][1]
. but it is not so straight forward that I can just import the files.
After some reading online, someone suggest that can try put every related files (markdown.es.js, markdown.es.js.map, markdown.wasm) into /public and link them straight. I tried that then import:
import * as markdown from "/wasm/markdown.es.js"
then got error below:
[ERROR] [vite] Internal server error: Cannot import non-asset file
/wasm/markdown.es.js which is inside /public. JS/CSS files inside
/public are copied as-is on build and can only be referenced viaor in html. If you want to get the URL of
that file, use /wasm/markdown.es.js?url instead.
My hunch is I still need to do some config at either vite
or svelte
or astro
side. But I am totally not sure how to start.
How can I resolve this?