Let me use svelte-browser-import
self-hosted (or offline) with less
boilerplate code.
Svelte is a very promising web UI framework, and thanks to svelte-browser-import you can even compile your project directly inside your browser, avoiding a separate build step for local development.
Unfortunately, with default options, svelte-browser-import
loads packages
from a hard-coded URL independent from where it itself is loaded from.
I want it to load its imports from where it itself was loaded, so I can
easily self-host my entire app (the development version of it) to save
internet traffic and also be able to efficiently develop it offline.
Fortunately, that is indeed possible, but you need to configure it to do so. This little package here does that config for me.
<div id="myCoolApp" class="svelteApp"></div>
<script type="module">import '/node_modules/selfhosted-svelte-browser-import-pmb/index.mjs';</script>
peerDependencies
installed../myCoolApp.svelte
into that <div>
.data-app-files="somethingElse.svelte"
.
It's plural because you may give multiple filenames, separated by
any combination of whitespace from the "Basic Latin" Unicode block.
ISC