diff --git a/src/client/alpine-loader.ts b/src/client/alpine-loader.ts index 02b6495..ad88c8e 100644 --- a/src/client/alpine-loader.ts +++ b/src/client/alpine-loader.ts @@ -1,12 +1,12 @@ -import type { PluginCallback } from 'alpinejs'; +import type { Alpine, PluginCallback } from 'alpinejs'; -export const app: PluginCallback = (Alpine) => { +export function app(Alpine: Alpine) { const modules = import.meta.glob('./**/*.{component,store}.ts', { - import: 'plugin', + import: 'default', eager: true, }); for (const plugin of Object.values(modules)) { Alpine.plugin(plugin); } -}; +} diff --git a/src/client/example.component.ts b/src/client/example.component.ts index bb3b411..7375e1f 100644 --- a/src/client/example.component.ts +++ b/src/client/example.component.ts @@ -1,6 +1,6 @@ -import type { PluginCallback } from 'alpinejs'; +import type { Alpine } from 'alpinejs'; -export const plugin: PluginCallback = (Alpine) => { +export default function (Alpine: Alpine) { Alpine.data('example', () => ({ init() { if (import.meta.env.DEV) { @@ -8,4 +8,4 @@ export const plugin: PluginCallback = (Alpine) => { } }, })); -}; +} diff --git a/src/client/example.store.ts b/src/client/example.store.ts index 645656a..afbd152 100644 --- a/src/client/example.store.ts +++ b/src/client/example.store.ts @@ -1,6 +1,6 @@ -import type { PluginCallback } from 'alpinejs'; +import type { Alpine } from 'alpinejs'; -export const plugin: PluginCallback = (Alpine) => { +export default function (Alpine: Alpine) { Alpine.store('example', { init() { if (import.meta.env.DEV) { @@ -8,4 +8,4 @@ export const plugin: PluginCallback = (Alpine) => { } }, }); -}; +}