Skip to content

Commit

Permalink
keep game files in production build
Browse files Browse the repository at this point in the history
because the thumbnail api function was removed and the game preview json files was only generated at build time, astro will optimize and remove the games since they were only read at build time as compared to every time a request was made when using the thumbnail api function
  • Loading branch information
JosiasAurel committed Jun 17, 2024
1 parent 561829e commit 344e671
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import vercel from '@astrojs/vercel/serverless'
import prefresh from '@prefresh/vite'
import svelte from '@astrojs/svelte'
import rehypeExternalLinks from 'rehype-external-links'
import fs from "node:fs";

const gameFiles = fs.readdirSync("games").filter(f => f.endsWith(".js")).map(game => `./games/${game}`);
import generateMetadata from "./src/integrations/generate-metadata"

export default defineConfig({
Expand All @@ -15,7 +17,9 @@ export default defineConfig({
generateMetadata()
],
output: 'server',
adapter: vercel(),
adapter: vercel({
includeFiles: gameFiles,
}),
vite: {
optimizeDeps: {
exclude: ['https']
Expand Down

0 comments on commit 344e671

Please sign in to comment.