diff --git a/.changeset/sour-games-boil.md b/.changeset/sour-games-boil.md new file mode 100644 index 000000000..9ed1f880d --- /dev/null +++ b/.changeset/sour-games-boil.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Adds support for hoisted scripts to the static build diff --git a/examples/fast-build/package.json b/examples/fast-build/package.json index 1fcdc03b2..a56885d52 100644 --- a/examples/fast-build/package.json +++ b/examples/fast-build/package.json @@ -11,6 +11,7 @@ }, "devDependencies": { "astro": "^0.22.16", + "preact": "~10.5.15", "unocss": "^0.15.5", "vite-imagetools": "^4.0.1" } diff --git a/examples/fast-build/src/components/ExternalHoisted.astro b/examples/fast-build/src/components/ExternalHoisted.astro new file mode 100644 index 000000000..a9e7d2ae2 --- /dev/null +++ b/examples/fast-build/src/components/ExternalHoisted.astro @@ -0,0 +1,2 @@ +
+ diff --git a/examples/fast-build/src/components/InlineHoisted.astro b/examples/fast-build/src/components/InlineHoisted.astro new file mode 100644 index 000000000..ba6c0ab4d --- /dev/null +++ b/examples/fast-build/src/components/InlineHoisted.astro @@ -0,0 +1,13 @@ + + diff --git a/examples/fast-build/src/pages/index.astro b/examples/fast-build/src/pages/index.astro index 9d4555b79..ef0136b27 100644 --- a/examples/fast-build/src/pages/index.astro +++ b/examples/fast-build/src/pages/index.astro @@ -4,6 +4,8 @@ import grayscaleUrl from '../images/random.jpg?grayscale=true'; import Greeting from '../components/Greeting.vue'; import Counter from '../components/Counter.vue'; import { Code } from 'astro/components'; +import InlineHoisted from '../components/InlineHoisted.astro'; +import ExternalHoisted from '../components/ExternalHoisted.astro'; --- @@ -44,5 +46,11 @@ import { Code } from 'astro/components';