From 8ded31d80c05c887230b3e63e93c9c91f2f036c8 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 27 Nov 2023 18:07:23 +0100 Subject: [PATCH] refactor: move check into processGraph --- src/lib/edge-functions/registry.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/edge-functions/registry.ts b/src/lib/edge-functions/registry.ts index 8819e2d696b..3144a49117a 100644 --- a/src/lib/edge-functions/registry.ts +++ b/src/lib/edge-functions/registry.ts @@ -126,10 +126,6 @@ export class EdgeFunctionsRegistry { throw new Error('Build error') } - if (this.functions.length === 0) { - return { warnings } - } - this.buildError = null // We use one index to loop over both internal and user function, because we know that this.#functions has internalFunctions first. @@ -408,7 +404,9 @@ export class EdgeFunctionsRegistry { */ private processGraph(graph: ModuleGraph | undefined) { if (!graph) { - warn('Could not process edge functions dependency graph. Live reload will not be available.') + if (this.functions.length !== 0) { + warn('Could not process edge functions dependency graph. Live reload will not be available.') + } return }