diff --git a/examples/minimal/astro.config.mjs b/examples/minimal/astro.config.mjs index f13c6cf8a9b76..882e6515a67e0 100644 --- a/examples/minimal/astro.config.mjs +++ b/examples/minimal/astro.config.mjs @@ -1,10 +1,4 @@ import { defineConfig } from 'astro/config'; -import node from '@astrojs/node'; // https://astro.build/config -export default defineConfig({ - output: 'server', - adapter: node({ - mode: 'standalone' - }) -}); +export default defineConfig({}); diff --git a/examples/minimal/src/pages/api/endpoint.ts b/examples/minimal/src/pages/api/endpoint.ts deleted file mode 100644 index 3ab6b8260f005..0000000000000 --- a/examples/minimal/src/pages/api/endpoint.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const output = 'server'; - -export const get = () => { - return new Response("Hello world!"); -} diff --git a/examples/minimal/src/pages/index.astro b/examples/minimal/src/pages/index.astro index 4181614b3b585..7264ff502db6b 100644 --- a/examples/minimal/src/pages/index.astro +++ b/examples/minimal/src/pages/index.astro @@ -1,5 +1,4 @@ --- -export const output = 'static'; --- diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index d111095cf488e..e1fe2b787fbac 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -282,7 +282,7 @@ async function cleanStaticOutput(opts: StaticBuildOptions, internals: BuildInter if (!allStaticFiles.has(filename.replace('server/', ''))) { return; } - // TODO: update file + await fs.promises.writeFile(url, 'export const _ = null;', { encoding: 'utf-8' }); }) ); // Map directories heads from the .mjs files diff --git a/packages/astro/src/core/build/vite-plugin-ssr.ts b/packages/astro/src/core/build/vite-plugin-ssr.ts index 392d05000d07b..be585551db434 100644 --- a/packages/astro/src/core/build/vite-plugin-ssr.ts +++ b/packages/astro/src/core/build/vite-plugin-ssr.ts @@ -13,6 +13,7 @@ import { pagesVirtualModuleId } from '../app/index.js'; import { serializeRouteData } from '../routing/index.js'; import { addRollupInput } from './add-rollup-input.js'; import { eachServerPageData, eachStaticPageData, sortedCSS } from './internal.js'; +import { getOutFile, getOutFolder } from './common.js'; export const virtualModuleId = '@astrojs-ssr-virtual-entry'; const resolvedVirtualModuleId = '\0' + virtualModuleId; @@ -134,12 +135,16 @@ function buildManifest( } for (const pageData of eachStaticPageData(internals)) { + const outFolder = getOutFolder(opts.settings.config, pageData.route.pathname!, pageData.route.type); + const outFile = getOutFile(opts.settings.config, outFolder, pageData.route.pathname!, pageData.route.type); + const file = outFile.toString().replace(opts.settings.config.build.client.toString(), ''); routes.push({ - file: `../client/${pageData.route.pathname}.html`, + file, links: [], scripts: [], routeData: serializeRouteData(pageData.route, settings.config.trailingSlash), }); + staticFiles.push(file); } for (const pageData of eachServerPageData(internals)) {