I’ve built packages using SvelteKit (docs) that I can use in other projects. The build folder typically consists of an index.js
that exports a ComponentName.svelte
. Then, in another project, I would import it by doing import { ComponentName } from "component-name"
.
Now I have a use case where I would prefer to import a package using eg. <script src="/path/to/component-name/script.js" />
.
Is it possible to use SvelteKit’s packaging whereby it builds a single script.js
file, instead of a build folder with multiple .js
and .svelte
files?