Open xeroticikot opened 2 years ago
Svelte doesn't support require so you have to use import instead, and since import creates a promise you need to use await on the import before initialising inside the DOM.
import { onMount } from "svelte";
import("halfmoon/css/halfmoon-variables.min.css");
onMount(async () => {
const halfmoon = await import("halfmoon");
halfmoon.default.onDOMContentLoaded();
});
How can npm installation can be used in sveltekit? Tried different ways, but nothing's working for me. Any reference would've been helpful & much appreciated.