Skip to content

Commit

Permalink
Revert "Fix: stop executing astro:server:setup twice (#6693)"
Browse files Browse the repository at this point in the history
This reverts commit c0b7864.
  • Loading branch information
bholmesdev committed Apr 7, 2023
1 parent f211245 commit fddf94d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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';
Expand Down Expand Up @@ -119,6 +120,7 @@ export async function createVite(
htmlVitePlugin(),
jsxVitePlugin({ settings, logging }),
astroPostprocessVitePlugin({ settings }),
astroIntegrationsContainerPlugin({ settings, logging }),
astroScriptsPageSSRPlugin({ settings }),
astroHeadPlugin({ settings }),
astroScannerPlugin({ settings }),
Expand Down
20 changes: 20 additions & 0 deletions packages/astro/src/vite-plugin-integrations-container/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 });
},
};
}

0 comments on commit fddf94d

Please sign in to comment.