diff --git a/.changeset/dirty-zoos-provide.md b/.changeset/dirty-zoos-provide.md new file mode 100644 index 000000000000..5c306e79a6f6 --- /dev/null +++ b/.changeset/dirty-zoos-provide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix: avoid calling `astro:server:setup` integration hook in production diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 1879daac83b3..54a8ce016fd9 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -19,7 +19,6 @@ import envVitePlugin from '../vite-plugin-env/index.js'; import astroHeadPlugin from '../vite-plugin-head/index.js'; import htmlVitePlugin from '../vite-plugin-html/index.js'; import { astroInjectEnvTsPlugin } from '../vite-plugin-inject-env-ts/index.js'; -import astroIntegrationsContainerPlugin from '../vite-plugin-integrations-container/index.js'; import jsxVitePlugin from '../vite-plugin-jsx/index.js'; import astroLoadFallbackPlugin from '../vite-plugin-load-fallback/index.js'; import markdownVitePlugin from '../vite-plugin-markdown/index.js'; @@ -119,7 +118,6 @@ export async function createVite( htmlVitePlugin(), jsxVitePlugin({ settings, logging }), astroPostprocessVitePlugin({ settings }), - astroIntegrationsContainerPlugin({ settings, logging }), astroScriptsPageSSRPlugin({ settings }), astroHeadPlugin({ settings }), astroScannerPlugin({ settings }), diff --git a/packages/astro/src/vite-plugin-integrations-container/index.ts b/packages/astro/src/vite-plugin-integrations-container/index.ts deleted file mode 100644 index 0169a6f71560..000000000000 --- a/packages/astro/src/vite-plugin-integrations-container/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Plugin as VitePlugin } from 'vite'; -import type { AstroSettings } from '../@types/astro.js'; -import type { LogOptions } from '../core/logger/core.js'; -import { runHookServerSetup } from '../integrations/index.js'; - -/** Connect Astro integrations into Vite, as needed. */ -export default function astroIntegrationsContainerPlugin({ - settings, - logging, -}: { - settings: AstroSettings; - logging: LogOptions; -}): VitePlugin { - return { - name: 'astro:integration-container', - configureServer(server) { - runHookServerSetup({ config: settings.config, server, logging }); - }, - }; -}