From 74e371c99d69845eeba67fece3871ee5009db98f Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Tue, 16 Apr 2024 16:08:49 -0400 Subject: [PATCH] fix(bundling): show codeframes for Rollup build errors --- 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 fc5dd300fc033..8476bc977d434 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 };