mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix: ensure injectRoute
works during build (#7986)
This commit is contained in:
parent
2c2e9362a2
commit
8e5a27b488
3 changed files with 8 additions and 1 deletions
5
.changeset/red-bikes-return.md
Normal file
5
.changeset/red-bikes-return.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Ensure injectRoute is properly handled in `build` as well as `dev`
|
|
@ -123,7 +123,7 @@ export async function createVite(
|
|||
htmlVitePlugin(),
|
||||
jsxVitePlugin({ settings, logging }),
|
||||
astroPostprocessVitePlugin(),
|
||||
mode === 'dev' && astroIntegrationsContainerPlugin({ settings, logging }),
|
||||
astroIntegrationsContainerPlugin({ settings, logging }),
|
||||
astroScriptsPageSSRPlugin({ settings }),
|
||||
astroHeadPlugin(),
|
||||
astroScannerPlugin({ settings, logging }),
|
||||
|
|
|
@ -17,9 +17,11 @@ export default function astroIntegrationsContainerPlugin({
|
|||
return {
|
||||
name: 'astro:integration-container',
|
||||
configureServer(server) {
|
||||
if (server.config.isProduction) return;
|
||||
runHookServerSetup({ config: settings.config, server, logging });
|
||||
},
|
||||
async buildStart() {
|
||||
if (settings.injectedRoutes.length === settings.resolvedInjectedRoutes.length) return;
|
||||
// Ensure the injectedRoutes are all resolved to their final paths through Rollup
|
||||
settings.resolvedInjectedRoutes = await Promise.all(
|
||||
settings.injectedRoutes.map((route) => resolveEntryPoint.call(this, route))
|
||||
|
|
Loading…
Reference in a new issue