Skip to content

Commit

Permalink
Allow Node.js APIs required by various build-time integrations.
Browse files Browse the repository at this point in the history
I *think* the run time ones are all Node-free, but Cloudflare’s Node.js compatibility layer should catch them.
  • Loading branch information
Southpaw1496 committed Nov 25, 2024
1 parent 0e6f59a commit 2906acd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default defineConfig({
vite: {
build: {
assetsInlineLimit: 0
},
ssr: {
// These are all Node.js APIs that don't work on Cloudflare. They are only used at build-time, but Astro doesn't understand that they won't be needed in the Cloudflare environment, so they have to be explicitly allowed.
external: ["child_process", "crypto", "fs", "module", "node:buffer", "node:child_process", "node:events", "node:fs", "node:os", "node:process", "node:path", "node:stream", "node:stream/promises", "node:string_decoder", "node:timers/promises", "node:url", "node:util", "node:tty", "node:v8", "os", "path", "stream", "string_decoder", "tty", "url", "util", "worker_threads","process"]
}
},

Expand Down

1 comment on commit 2906acd

@Cozy-GitHub
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See preview on Cloudflare Pages: https://c7b209da.quiltmc-org.pages.dev

Please sign in to comment.