UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

18 lines (17 loc) • 501 B
import { ASTRO_VITE_ENVIRONMENT_NAMES } from "../core/constants.js"; import { patchOverlay } from "../core/errors/overlay.js"; export function vitePluginAstroServerClient() { return { name: "astro:server-client", applyToEnvironment(environment) { return environment.name === ASTRO_VITE_ENVIRONMENT_NAMES.client; }, transform: { filter: { id: /vite\/dist\/client\/client\.mjs/ }, handler(code) { // Replace the Vite overlay with ours return patchOverlay(code); } } }; }