From 7a6469baed7d422dc2958b0776ec0ed9c9f2aa01 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 Jul 2024 22:43:19 +0200 Subject: [PATCH] fix(rollup): keep empty type-only modules --- src/builders/rollup/plugins/esbuild.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/builders/rollup/plugins/esbuild.ts b/src/builders/rollup/plugins/esbuild.ts index 73384f74..946577a6 100644 --- a/src/builders/rollup/plugins/esbuild.ts +++ b/src/builders/rollup/plugins/esbuild.ts @@ -79,12 +79,10 @@ export function esbuild(options: EsbuildOptions): Plugin { printWarnings(id, result, this); - return result.code - ? { - code: result.code, - map: result.map || null, - } - : null; + return { + code: result.code || "", + map: result.map || null, + }; }, async renderChunk( @@ -108,7 +106,7 @@ export function esbuild(options: EsbuildOptions): Plugin { minify: true, }); return { - code: result.code, + code: result.code || "", map: result.map || null, }; },