fix: config via build.lib fails when default entry point not found (#393)
This commit is contained in:
parent
27ade03acf
commit
ad891af811
|
@ -11,7 +11,7 @@ export interface ElectronPluginOptions {
|
||||||
root?: string
|
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 name of ['index', scope]) {
|
||||||
for (const ext of ['js', 'ts', 'mjs', 'cjs']) {
|
for (const ext of ['js', 'ts', 'mjs', 'cjs']) {
|
||||||
const entryFile = path.resolve(root, 'src', scope, `${name}.${ext}`)
|
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 {
|
function findInput(root: string, scope = 'renderer'): string {
|
||||||
|
|
Loading…
Reference in a new issue