chore: fixing bundler

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-04-13 14:22:44 +02:00
parent 4df8b12879
commit 4cc321812b
+9
View File
@@ -69,6 +69,10 @@ export async function buildBundle(options: BuildOptions) {
throw new Error(`Failed to compile.\n${error.message || error}`);
});
if (!stats) {
throw new Error('No stats returned');
}
if (statsJsonEnabled) {
// No @types/bfj
await require('bfj').write(
@@ -95,6 +99,8 @@ async function build(compiler: webpack.Compiler, isCi: boolean) {
const { errors } = formatWebpackMessages({
errors: [err.message],
warnings: new Array<string>(),
_showErrors: true,
_showWarnings: true,
});
throw new Error(errors[0]);
@@ -108,6 +114,9 @@ async function build(compiler: webpack.Compiler, isCi: boolean) {
},
);
if (!stats) {
throw new Error('No stats provided');
}
const { errors, warnings } = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true }),
);