Skip to content

Commit 6c53d60

Browse files
fix: Handle Webpack compilation errors when building execution environments
1 parent 7cffbee commit 6c53d60

File tree

1 file changed

+17
-0
lines changed
  • packages/snaps-execution-environments/scripts

1 file changed

+17
-0
lines changed

packages/snaps-execution-environments/scripts/build.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ webpack(config, (error, stats) => {
2525
);
2626

2727
console.log(indent(error.message, 2));
28+
process.exitCode = 1;
29+
return;
30+
}
31+
32+
if (stats.hasErrors()) {
33+
console.error(
34+
'Webpack failed to build. See the error(s) below for more details.',
35+
);
36+
37+
console.log(
38+
stats.toString({
39+
all: false,
40+
colors: true,
41+
errors: true,
42+
}),
43+
);
44+
process.exitCode = 1;
2845
return;
2946
}
3047

0 commit comments

Comments
 (0)