Skip to content

Commit

Permalink
fix: should skip empty output
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jul 19, 2023
1 parent 3ae0729 commit 6143b8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ interface OutputOptions {
}

function handleOutputOption(conf: ResolvedConfig, outputs: OutputOptions[]) {
// issue #39
// In some case like vite-plugin-legacy will set an empty output item
// we should skip it.
if (conf.build.rollupOptions?.output) {
const outputOptions = Array.isArray(conf.build.rollupOptions.output)
? conf.build.rollupOptions.output
: [conf.build.rollupOptions.output]
outputOptions.forEach((opt) => {
if (typeof opt === 'object' && !len(Object.keys(opt))) return
outputs.push({ dest: opt.dir || conf.build.outDir })
})
return
Expand Down

0 comments on commit 6143b8a

Please sign in to comment.