From a2924d872a6c6f21d1dfbe3c11280d7c43bb39f9 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 25 Nov 2024 15:08:55 -0600 Subject: [PATCH] fix: Revert "Validate entrypoints after hooks have modified them (54baf21)" This reverts commit 54baf21490c996cce441a5183e04a8c89725941c. --- .../wxt/src/core/utils/building/find-entrypoints.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/wxt/src/core/utils/building/find-entrypoints.ts b/packages/wxt/src/core/utils/building/find-entrypoints.ts index 12ceb099..72ac7436 100644 --- a/packages/wxt/src/core/utils/building/find-entrypoints.ts +++ b/packages/wxt/src/core/utils/building/find-entrypoints.ts @@ -77,6 +77,10 @@ export async function findEntrypoints(): Promise { return results; }, []); + // Validation + preventNoEntrypoints(entrypointInfos); + preventDuplicateEntrypointNames(entrypointInfos); + // Import entrypoints to get their config let hasBackground = false; const env = createExtensionEnvironment(); @@ -170,10 +174,6 @@ export async function findEntrypoints(): Promise { wxt.logger.debug(`${wxt.config.browser} entrypoints:`, targetEntrypoints); await wxt.hooks.callHook('entrypoints:resolved', wxt, targetEntrypoints); - // Validation - preventNoEntrypoints(targetEntrypoints); - preventDuplicateEntrypointNames(targetEntrypoints); - return targetEntrypoints; } @@ -187,7 +187,7 @@ interface EntrypointInfo { skipped: boolean; } -function preventDuplicateEntrypointNames(files: Entrypoint[]) { +function preventDuplicateEntrypointNames(files: EntrypointInfo[]) { const namesToPaths = files.reduce>( (map, { name, inputPath }) => { map[name] ??= []; @@ -216,7 +216,7 @@ function preventDuplicateEntrypointNames(files: Entrypoint[]) { } } -function preventNoEntrypoints(files: Entrypoint[]) { +function preventNoEntrypoints(files: EntrypointInfo[]) { if (files.length === 0) { throw Error(`No entrypoints found in ${wxt.config.entrypointsDir}`); }