Browse Source

webui: show the actual error when compressJs fails

note that this does not show the correct error line b/c we filter this
through the remover() first
mcspr-patch-1
Maxim Prokhorov 3 years ago
parent
commit
c6e2dbbc5a
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      code/gulpfile.js

+ 6
- 1
code/gulpfile.js View File

@ -116,7 +116,12 @@ var compressJs = function() {
}
if (source.path.endsWith("custom.js")) {
var result = terser.minify(source.contents.toString());
var contents = source.contents.toString();
var result = terser.minify(contents);
if (result.error) {
var { message, filename, line, col, pos } = result.error;
throw new Error("terser error `" + message + "` in file " + filename + ", at line " + line);
}
source.contents = Buffer.from(result.code);
this.push(source);


Loading…
Cancel
Save