Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Aug 7, 2023
1 parent c2682a1 commit f6845d9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/astro/src/vite-plugin-integrations-container/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Plugin as VitePlugin } from 'vite';
import type { PluginContext } from 'rollup';
import type { Plugin as VitePlugin } from 'vite';
import type { AstroSettings, InjectedRoute, ResolvedInjectedRoute } from '../@types/astro.js';
import type { LogOptions } from '../core/logger/core.js';

Expand All @@ -21,14 +21,19 @@ export default function astroIntegrationsContainerPlugin({
},
async buildStart() {
// 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)
.then(res => res?.id)
.then((res) => res?.id)
.catch(() => undefined);
if (!resolvedId) return route;

Expand Down

0 comments on commit f6845d9

Please sign in to comment.