Skip to content

Commit bf84f06

Browse files
AdrianGonz97sxzz
andauthored
fix: support object input (#20)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
1 parent 481ed71 commit bf84f06

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ export const IsolatedDecl: UnpluginInstance<Options | undefined, false> =
3535

3636
const rollup: Partial<Plugin> = {
3737
renderStart(outputOptions, inputOptions) {
38-
let outBase = ''
39-
let input = inputOptions.input
40-
input = typeof input === 'string' ? [input] : input
41-
if (Array.isArray(input)) {
42-
outBase = lowestCommonAncestor(...input)
43-
}
38+
const { input } = inputOptions
39+
const normalizedInput =
40+
typeof input === 'string'
41+
? [input]
42+
: Array.isArray(input)
43+
? input
44+
: Object.values(input)
45+
const outBase = lowestCommonAncestor(...normalizedInput)
4446

4547
if (typeof outputOptions.entryFileNames !== 'string') {
4648
return this.error('entryFileNames must be a string')

0 commit comments

Comments
 (0)