Skip to content

Astro client-side scripts #729

Answered by daun
riolly asked this question in Help
Discussion options

You must be logged in to vote

Welcome! We've had a similar question recently, you should find some pointers there. When opening your StackBlitz link, I'm getting a SyntaxError: Cannot use import statement outside a module — that's because adding the data-swup-ignore attribute will make Astro skip bundling the script and treat it like is:inline. This is what the docs say:

Astro’s default bundling behavior will be disabled in some situations. In particular, adding type="module" or any attribute other than src to a <script> tag will cause Astro to treat the tag as if it had an is:inline directive.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by riolly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #727 on July 20, 2023 07:13.