mirror of
https://github.com/withastro/astro.git
synced 2025-01-22 10:31:53 -05:00
fix(alpinejs): start on DOMContentLoaded (#13014)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
This commit is contained in:
parent
8fb3bea857
commit
820eee334b
2 changed files with 6 additions and 1 deletions
5
.changeset/tall-bears-return.md
Normal file
5
.changeset/tall-bears-return.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/alpinejs": patch
|
||||
---
|
||||
|
||||
Fixes an issue with user scripts running after `Alpine.start()`
|
|
@ -98,7 +98,7 @@ export default function createPlugin(options?: Options): AstroIntegration {
|
|||
import { setup } from 'virtual:@astrojs/alpinejs/entrypoint';
|
||||
setup(Alpine);
|
||||
window.Alpine = Alpine;
|
||||
Alpine.start();`,
|
||||
document.addEventListener('DOMContentLoaded', () => Alpine.start());`
|
||||
);
|
||||
updateConfig({
|
||||
vite: {
|
||||
|
|
Loading…
Reference in a new issue