Commit 520648cf authored by Philipp Nowinski's avatar Philipp Nowinski

[FEATURE] better JS bundler error handling

parent c8d4a113
......@@ -162,7 +162,12 @@ module.exports = class Js extends Task {
}
bundler = bundler.bundle().on('error', (_error) => {
this._handleError(_error.annotated);
if (_error.hasOwnProperty('annotated')) {
this._handleError(_error.annotated);
} else {
const errorMessage = `${_error.message}\n\n ${chalk.bgMagenta(chalk.black(' Stacktrace: '))}\n\n${chalk.bgMagenta(chalk.black(_error.stack))}\n`;
this._handleError(errorMessage);
}
});
if (this._config.jsPipeline.sourceMaps) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment