He have been using Oracle JET for a while.... During our release builds sometimes there are failures reported by Uglify JS, for instance :
grunt build:release
copy files to staging directory.....
copy finished...
copy library files to staging directory.....
copy finished...
compiling sass....
sass compile
from /Users/DARANGEL/Documents/src/uno-ui/src/themes/blue/web/blue.scss
to /Users/DARANGEL/Documents/src/uno-ui/themes/blue/web/blue.min.css finished..
sass compile finished...
running theme injection task.....
indexHtml theme path injection finished..
running theme copy task.....
theme copy finished...
running injection task.....
mainJs paths injection finished..
running uglify tasks.....
>> SyntaxError: Unexpected token: name (stack)
As we couldn't find any documentation on how to actually display which file is causing the above failure... we had to make a change in the uglify code with a really ugly workaround, We found the related code that was throwing the error and then we added a trace command :
/node-modules/uglify-js/lib/parse.js
function unexpected(token) {
console.trace() // HERE THE DIAGNOSTIC CHANGE TO DETERMINE THE FAILURE
if (token == null)
token = S.token;
token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
};
Which eventually printed the stack and we were able to track the specific file that was causing the error.
As you can see this is not a reliable/scalable way to find uglify violations... Is there a way to pass a VERBOSE or DEBUG parameter to the mentioned command to simplify the recognition of errors during the build ?
Thanks
Daniel