astro/.changeset/young-trainers-rule.md
Matthew Phillips 788c769d78
Implementation of hoisted scripts (#1178)
* Implementation of hoisted scripts

* Use the facade id

* Adds docs on hoisted scripts

* Don't try to run rollup if there are no hoisted scripts

* Handle scripts possibly being undefined (client:only)

* Get rid of changes to the portfolio example

* Adds a changeset

* Remove a todo

* Fix lint errors

* Rename TransformResult property to hoistedScripts

* Move Hoisted Scripts docs to astro-components page

* Fixes lint errors

* Fix path join for windows
2021-08-27 10:12:27 -04:00

258 B

docs astro
patch patch

Hoisted scripts

This change adds support for hoisted scripts, allowing you to bundle scripts together for a page and hoist them to the top (in the head):

<script hoist>
  // Anything goes here!
</script>