integrations/node-namespace
이 콘텐츠는 아직 번역되지 않았습니다.
Functions
Section titled “Functions”nodeNamespaceBuiltinsAstro()
Section titled “nodeNamespaceBuiltinsAstro()”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.
Returns
Section titled “Returns”AstroIntegration
An Astro integration for handling Node.js built-in modules.