-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
As far as I can tell there's no way to use sveltekit runtime imports (eg: $app/navigation
) outside of sveltekit dev/build. Which makes testing virtually impossible. If there is a way to shim these imports outside of the main sveltekit context I haven't found it, so perhaps documentation is needed.
My particular use-case is with Storybook, where UI components that rely on any sveltekit modules break the whole setup. I tried aliasing them with webpack (pointing to .svelte-kit/dev/...
) but that didn't work either.
Another use-case is publishing components for sveltekit that would need to rely on those imports.
To Reproduce
- Setup storybook with Sveltekit
- Create a component that imports a runtime module (eg:
$app/env
) - Run storybook and see if fail (
cannot resolve module $app/env
)
Severity
Not blocking, but makes building a component library with Storybook or other development/testing frameworks impossible. So, severe annoyance?