-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
When building a static site with @astrojs/cloudflare, Vite produces many warnings about Node.js built-in modules being externalized from @levino/shipyard-docs:
[WARN] [vite] Automatically externalized node built-in module "node:fs" imported from "@levino/shipyard-docs/src/index.ts"
[WARN] [vite] Automatically externalized node built-in module "node:path" imported from "@levino/shipyard-docs/src/index.ts"
[WARN] [vite] Automatically externalized node built-in module "node:child_process" imported from "@levino/shipyard-docs/src/gitMetadata.ts"
Affected Files
@levino/shipyard-docs/src/index.ts→ importsnode:fs,node:path@levino/shipyard-docs/src/gitMetadata.ts→ importsnode:child_process
Why This Matters
- Noisy build output - Dozens of warnings clutter the build log
- Runtime compatibility - These modules don't exist in edge runtimes (Cloudflare Workers, Deno Deploy, etc.)
- Bundle size - Even if externalized, the import attempts add overhead
Expected Behavior
An Astro integration should avoid Node.js built-ins in code that might run at request time, or clearly separate build-time utilities from runtime code.
Suggested Fix
gitMetadata.ts: Move git operations to a Vite plugin or build hook that only runs at build timeindex.ts: Review iffs/pathusage can be replaced with Astro's content APIs or moved to build-time only
Metadata
Metadata
Assignees
Labels
No labels