From fed1a9e3a1d5473e4c2560600e746499861568f6 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Tue, 16 Apr 2024 16:39:22 -0400 Subject: [PATCH] fix(bundling): show codeframes for Rollup build errors (#22845) --- packages/rollup/src/executors/rollup/rollup.impl.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/rollup/src/executors/rollup/rollup.impl.ts b/packages/rollup/src/executors/rollup/rollup.impl.ts index fc5dd300fc033f..8476bc977d4346 100644 --- a/packages/rollup/src/executors/rollup/rollup.impl.ts +++ b/packages/rollup/src/executors/rollup/rollup.impl.ts @@ -138,6 +138,10 @@ export async function* rollupExecutor( logger.info(`⚡ Done in ${duration}`); return { success: true, outfile }; } catch (e) { + if (e.formatted) { + // Formattted message is provided by Rollup and contains codeframes for where the error occurred. + logger.info(e.formatted); + } logger.error(e); logger.error(`Bundle failed: ${context.projectName}`); return { success: false };