dojo / util

Dojo 1 - build utilities. Please submit bugs to https://bugs.dojotoolkit.org/
https://dojotoolkit.org/
Other
60 stars 105 forks source link

Build throws syntax errors for ES6+ code even when transforming back to ES3 #89

Open estermer opened 3 years ago

estermer commented 3 years ago

Look like this is a recurring issue but I wanted to open this anyways.

for reference: Stack Overflow Question Dojo Bug Ticket

It is my understanding that by adding optimizeOptions with languageIn/languageOut (which are also defaulted) the Closure Compiler will transform the ES6+ code to an earlier version of ECMAScript.

When we do this, it looks like in the process of the build, there is a util/build/transform/depsScan to see if the module and its deps are "Pure AMD" BEFORE the transformation of langIn -> langOut happens.

Is it absolutely necessary to keep the order of the gates as is, or can we reorder them so that the transformation to ES5- happens first and then the AST depsScan happens next?

Is there a status on how to solve this issue? Or should I just live with all the console errors and ignore them since what is a syntax error is being transformed anyways?