[ci] format
This commit is contained in:
parent
c2682a17c0
commit
f6845d94f5
1 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import type { Plugin as VitePlugin } from 'vite';
|
|
||||||
import type { PluginContext } from 'rollup';
|
import type { PluginContext } from 'rollup';
|
||||||
|
import type { Plugin as VitePlugin } from 'vite';
|
||||||
import type { AstroSettings, InjectedRoute, ResolvedInjectedRoute } from '../@types/astro.js';
|
import type { AstroSettings, InjectedRoute, ResolvedInjectedRoute } from '../@types/astro.js';
|
||||||
import type { LogOptions } from '../core/logger/core.js';
|
import type { LogOptions } from '../core/logger/core.js';
|
||||||
|
|
||||||
|
@ -21,14 +21,19 @@ export default function astroIntegrationsContainerPlugin({
|
||||||
},
|
},
|
||||||
async buildStart() {
|
async buildStart() {
|
||||||
// Ensure the injectedRoutes are all resolved to their final paths through Rollup
|
// 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)))
|
settings.resolvedInjectedRoutes = await Promise.all(
|
||||||
|
settings.injectedRoutes.map((route) => resolveEntryPoint.call(this, route))
|
||||||
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resolveEntryPoint(this: PluginContext, route: InjectedRoute): Promise<ResolvedInjectedRoute> {
|
async function resolveEntryPoint(
|
||||||
|
this: PluginContext,
|
||||||
|
route: InjectedRoute
|
||||||
|
): Promise<ResolvedInjectedRoute> {
|
||||||
const resolvedId = await this.resolve(route.entryPoint)
|
const resolvedId = await this.resolve(route.entryPoint)
|
||||||
.then(res => res?.id)
|
.then((res) => res?.id)
|
||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
if (!resolvedId) return route;
|
if (!resolvedId) return route;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue