From c0b7864a41dd9f31e5a588208d1ff806d4edf047 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Tue, 28 Mar 2023 13:43:16 -0400 Subject: [PATCH] Fix: stop executing `astro:server:setup` twice (#6693) * fix: remove integrations container plugin * chore: changeset --- .changeset/dirty-zoos-provide.md | 5 +++++ packages/astro/src/core/create-vite.ts | 2 -- .../index.ts | 20 ------------------- 3 files changed, 5 insertions(+), 22 deletions(-) create mode 100644 .changeset/dirty-zoos-provide.md delete mode 100644 packages/astro/src/vite-plugin-integrations-container/index.ts diff --git a/.changeset/dirty-zoos-provide.md b/.changeset/dirty-zoos-provide.md new file mode 100644 index 000000000..5c306e79a --- /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 1879daac8..54a8ce016 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 0169a6f71..000000000 --- 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 }); - }, - }; -}