From 6143b8ae8c890b6b27f92b909ccca5dd7c66ecc5 Mon Sep 17 00:00:00 2001 From: kanno <812137533@qq.com> Date: Thu, 20 Jul 2023 00:08:35 +0800 Subject: [PATCH] fix: should skip empty output --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 6105197..6f9bca7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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