diff --git a/lib/integration/AdaptFramework/build.js b/lib/integration/AdaptFramework/build.js index 25b0160..523f925 100644 --- a/lib/integration/AdaptFramework/build.js +++ b/lib/integration/AdaptFramework/build.js @@ -28,10 +28,17 @@ export default async function adaptBuild ({ ].filter(Boolean).join(' '); exec(cmd, { cwd }, (error, stdout, stderr) => { if(error || stderr) { - const matches = stdout.match(/>> Error:\s(.+)\s/); + // Surface the salient failure rather than the whole grunt transcript: + // a '>> Error:' task message, else a bare 'Error:' line (e.g. a rollup + // load failure from the javascript task), else the failing-task warning. + // Fall back to the full stdout only when none of those are present. + const matches = stdout.match(/>> Error:\s(.+)/) || + stdout.match(/^Error:\s(.+)/m) || + stdout.match(/(Warning: Task .+ failed)/); const e = new Error('grunt tasks failed') e.cmd = cmd; e.raw = matches?.[1] ?? stdout; + e.stdout = stdout; e.source = error; e.stderr = stderr; return reject(e)