Alternative to copying flyonui.js in Svelte manually to static directory? #28
arnoldknott
started this conversation in
Ideas / Request new feature
Replies: 1 comment
-
|
Here's another way: <script lang="ts">
const loadHSStaticMethods = async () => {
const {HSStaticMethods} = await import('flyonui/flyonui.js')
return HSStaticMethods;
}
const initFlyonui = (_node: HTMLElement) => {
afterNavigate( () => {
loadHSStaticMethods().then((loadedHSStaticMethods) => {
// console.log('layout - client - -effect calling - autoInit')
loadedHSStaticMethods.autoInit();
})
})
}
</script>
<svelte:window use:initFlyonui />Unfortunately, I couldn't get `<svelte:window onload={initFlyonui} /> to work. It's not triggering. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It appears a bit error-prone to me, to copy the
flyonui.jsmanully into the static directory according to Svelte setup guide step 3 & 4.this would need to be done again in all future updates and very likely to get missed.
I wonder if adding this
to
src/routes/+layout.sveltecould do the job automatically and always uses the latest installed version innode_modules?Beta Was this translation helpful? Give feedback.
All reactions