diff --git a/.changeset/eleven-monkeys-yell.md b/.changeset/eleven-monkeys-yell.md
new file mode 100644
index 000000000..2c0d7bc80
--- /dev/null
+++ b/.changeset/eleven-monkeys-yell.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Update rollup to fix default param regression
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 6cec560a8..dddbe0f82 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -119,7 +119,7 @@
"prompts": "^2.4.2",
"recast": "^0.20.5",
"resolve": "^1.22.0",
- "rollup": "^2.75.4",
+ "rollup": "^2.75.5",
"semver": "^7.3.7",
"serialize-javascript": "^6.0.0",
"shiki": "^0.10.1",
diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts
index 3fa065373..8a76e2e05 100644
--- a/packages/astro/src/core/build/static-build.ts
+++ b/packages/astro/src/core/build/static-build.ts
@@ -132,8 +132,11 @@ export async function staticBuild(opts: StaticBuildOptions) {
timer.generate = performance.now();
if (opts.buildConfig.staticMode) {
- await generatePages(ssrResult, opts, internals, facadeIdToPageDataMap);
- await cleanSsrOutput(opts);
+ try {
+ await generatePages(ssrResult, opts, internals, facadeIdToPageDataMap);
+ } finally {
+ await cleanSsrOutput(opts);
+ }
} else {
info(opts.logging, null, `\n${bgMagenta(black(' finalizing server assets '))}\n`);
await ssrMoveAssets(opts);
diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts
index a510f2eee..672fe5a0f 100644
--- a/packages/astro/src/vite-plugin-env/index.ts
+++ b/packages/astro/src/vite-plugin-env/index.ts
@@ -85,6 +85,7 @@ export default function envVitePlugin({
replacements = Object.fromEntries(entries);
// These additional replacements are needed to match Vite
replacements = Object.assign(replacements, {
+ 'import.meta.env.SITE': astroConfig.site ? `'${astroConfig.site}'` : 'undefined',
// This catches destructed `import.meta.env` calls,
// BUT we only want to inject private keys referenced in the file.
// We overwrite this value on a per-file basis.
diff --git a/packages/astro/test/astro-envs.test.js b/packages/astro/test/astro-envs.test.js
index f44b007c8..da2332c9e 100644
--- a/packages/astro/test/astro-envs.test.js
+++ b/packages/astro/test/astro-envs.test.js
@@ -30,6 +30,11 @@ describe('Environment Variables', () => {
expect(indexHtml).to.include('BLUE_BAYOU');
});
+ it('does render builtin SITE env', async () => {
+ let indexHtml = await fixture.readFile('/index.html');
+ expect(indexHtml).to.include('http://example.com');
+ });
+
it('includes public env in client-side JS', async () => {
let dirs = await fixture.readdir('/');
let found = false;
diff --git a/packages/astro/test/fixtures/astro-envs/astro.config.mjs b/packages/astro/test/fixtures/astro-envs/astro.config.mjs
index 881930612..7bb1b85f1 100644
--- a/packages/astro/test/fixtures/astro-envs/astro.config.mjs
+++ b/packages/astro/test/fixtures/astro-envs/astro.config.mjs
@@ -3,5 +3,6 @@ import vue from '@astrojs/vue';
// https://astro.build/config
export default defineConfig({
+ site: 'http://example.com',
integrations: [vue()],
});
diff --git a/packages/astro/test/fixtures/astro-envs/src/pages/index.astro b/packages/astro/test/fixtures/astro-envs/src/pages/index.astro
index f71c11db7..3c265dbef 100644
--- a/packages/astro/test/fixtures/astro-envs/src/pages/index.astro
+++ b/packages/astro/test/fixtures/astro-envs/src/pages/index.astro
@@ -3,4 +3,5 @@ import Client from '../components/Client.vue';
---
+ {body}
+