From ad891af811adaeb4a928661a342c90c4075a49e9 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 1 Mar 2024 23:06:09 +0800 Subject: [PATCH] fix: config via build.lib fails when default entry point not found (#393) --- src/plugins/electron.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/electron.ts b/src/plugins/electron.ts index df53198..4c1bb84 100644 --- a/src/plugins/electron.ts +++ b/src/plugins/electron.ts @@ -11,7 +11,7 @@ export interface ElectronPluginOptions { root?: string } -function findLibEntry(root: string, scope: string): string { +function findLibEntry(root: string, scope: string): string | undefined { for (const name of ['index', scope]) { for (const ext of ['js', 'ts', 'mjs', 'cjs']) { const entryFile = path.resolve(root, 'src', scope, `${name}.${ext}`) @@ -20,7 +20,7 @@ function findLibEntry(root: string, scope: string): string { } } } - return '' + return undefined } function findInput(root: string, scope = 'renderer'): string {