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
-
It appears a bit error-prone to me, to copy the
flyonui.js
manully 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.svelte
could do the job automatically and always uses the latest installed version innode_modules
?Beta Was this translation helpful? Give feedback.
All reactions