跳转到内容

integrations/node-namespace

此内容尚不支持你的语言。

function nodeNamespaceBuiltinsAstro(): AstroIntegration

Defined in: studiocms/packages/studiocms/src/integrations/node-namespace.ts:18^

Creates an Astro integration that injects a Vite plugin to automatically resolve Node.js built-in modules using the node: protocol namespace.

This integration ensures that imports of Node.js built-ins (e.g., ‘fs’, ‘path’) are rewritten to use the node: prefix and marked as external, preventing bundling and ensuring correct module resolution in Vite-powered Astro projects.

The integration checks if the ‘namespace-builtins’ Vite plugin is already present before adding it, to avoid duplicate plugins.

AstroIntegration

An Astro integration for handling Node.js built-in modules.