Fix: stop executing astro:server:setup
twice (#6693)
* fix: remove integrations container plugin * chore: changeset
This commit is contained in:
parent
af108e4b4a
commit
c0b7864a41
3 changed files with 5 additions and 22 deletions
5
.changeset/dirty-zoos-provide.md
Normal file
5
.changeset/dirty-zoos-provide.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix: avoid calling `astro:server:setup` integration hook in production
|
|
@ -19,7 +19,6 @@ import envVitePlugin from '../vite-plugin-env/index.js';
|
||||||
import astroHeadPlugin from '../vite-plugin-head/index.js';
|
import astroHeadPlugin from '../vite-plugin-head/index.js';
|
||||||
import htmlVitePlugin from '../vite-plugin-html/index.js';
|
import htmlVitePlugin from '../vite-plugin-html/index.js';
|
||||||
import { astroInjectEnvTsPlugin } from '../vite-plugin-inject-env-ts/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 jsxVitePlugin from '../vite-plugin-jsx/index.js';
|
||||||
import astroLoadFallbackPlugin from '../vite-plugin-load-fallback/index.js';
|
import astroLoadFallbackPlugin from '../vite-plugin-load-fallback/index.js';
|
||||||
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
||||||
|
@ -119,7 +118,6 @@ export async function createVite(
|
||||||
htmlVitePlugin(),
|
htmlVitePlugin(),
|
||||||
jsxVitePlugin({ settings, logging }),
|
jsxVitePlugin({ settings, logging }),
|
||||||
astroPostprocessVitePlugin({ settings }),
|
astroPostprocessVitePlugin({ settings }),
|
||||||
astroIntegrationsContainerPlugin({ settings, logging }),
|
|
||||||
astroScriptsPageSSRPlugin({ settings }),
|
astroScriptsPageSSRPlugin({ settings }),
|
||||||
astroHeadPlugin({ settings }),
|
astroHeadPlugin({ settings }),
|
||||||
astroScannerPlugin({ settings }),
|
astroScannerPlugin({ settings }),
|
||||||
|
|
|
@ -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 });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue