kit icon indicating copy to clipboard operation
kit copied to clipboard

Add a hook to run some code during preloading code

Open CNSeniorious000 opened this issue 6 months ago • 0 comments

Describe the problem

Some module is large, but not compatible with SSR. So I can only import it dynamically in an onMount or if (browser) block. But I still want them to be preloaded during that page got preloaded by preloadCode or data-sveltekit-preload-code.

An example is monaco-editor.

Describe the proposed solution

Add a hook like beforePreload in $app/navigation.

Alternatives considered

For now I can only write them in on:mouseover besides data-sveltekit-preload-code or write them after preloadCode

Importance

nice to have

Additional Information

No response

CNSeniorious000 avatar Aug 04 '24 11:08 CNSeniorious000