@storm-software/unbuild
Version:
A package containing `unbuild` utilities for building Storm Software libraries and applications
35 lines (30 loc) • 702 B
JavaScript
import {
writeError
} from "./chunk-DY4PAY36.js";
// src/plugins/on-error.ts
var onErrorPlugin = (options) => ({
name: "storm:on-error",
buildEnd(error) {
if (error) {
writeError(
`The following errors occurred during the build:
${error ? error.message : "Unknown build error"}
`,
options.config
);
throw new Error("Storm unbuild process failed with errors.");
}
},
renderError(error) {
writeError(
`The following errors occurred during the build:
${error ? error.message : "Unknown build error"}
`,
options.config
);
throw new Error("Storm unbuild process failed with errors.");
}
});
export {
onErrorPlugin
};