Skip to content

Commit

Permalink
Update packages to fix Astro sitemap + Vercel integration issue (with…
Browse files Browse the repository at this point in the history
  • Loading branch information
FluxCapacitor2 committed Jan 23, 2025
1 parent fb41b3f commit 608ab98
Show file tree
Hide file tree
Showing 3 changed files with 4,571 additions and 5,860 deletions.
21 changes: 0 additions & 21 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import tailwind from "@astrojs/tailwind";
import vercel from "@astrojs/vercel";
import icon from "astro-icon";
import { defineConfig } from "astro/config";
import { copyFile, readdir } from "node:fs/promises";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import rehypePrettyCode from "rehype-pretty-code";

// https://astro.build/config
Expand All @@ -17,24 +14,6 @@ export default defineConfig({
sitemap(),
tailwind({ applyBaseStyles: false }),
icon(),
process.env.VERCEL
? {
// https://github.com/withastro/adapters/issues/445
name: "copy-sitemap-to-vercel-output-dir",
hooks: {
"astro:build:done": async ({ dir }) => {
const distDir = fileURLToPath(dir);
const staticDir = resolve(".vercel/output/static");
const files = await readdir(distDir);
for (const sitemap of files.filter((it) =>
it.includes("sitemap")
)) {
copyFile(join(distDir, sitemap), join(staticDir, sitemap));
}
},
},
}
: undefined,
],
adapter: process.env.VERCEL ? vercel() : undefined,
markdown: {
Expand Down
Loading

0 comments on commit 608ab98

Please sign in to comment.