Option not to auto start CDN version #1776
Replies: 3 comments 4 replies
-
There was a PR to support this but was not added. You can read comments here #1721. I'd suggest you move all your stores and components into event listener using |
Beta Was this translation helpful? Give feedback.
-
@mikestempien - the file included from "import Alpine from alpinejs" shouldn't auto start - is that what you're experiencing? |
Beta Was this translation helpful? Give feedback.
-
@mikestempien , you can import and use the module build to load Alpine from a script tag and not auto-initialize: <script type="module">
import Alpine from 'https://unpkg.com/[email protected]/dist/module.esm.js'
window.Alpine = Alpine
Alpine.start()
</script> If you need more control over starting Alpine, just leave out the Hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Since in the setup I'm working with I'm bundling all the libs into
vendor.js
and then init the scripts inapp.js
, I'm having a problem with Alpine auto-starting before I set up stores and components inapp.js
. Maybe we could check for some var ex:window.someVarSoAlpineWontAutoStart = true
and don't start it automatically then?See also:
Beta Was this translation helpful? Give feedback.
All reactions