In my current project I have a lot of global variables: (not declared with var)
HELLO = 'Hello';
I installed babel so I can use all the ES next functions, but it seems babel doesn't now how to deal with global variables
.babelrc
{
"presets": [
[
"@babel/preset-env",
{
"modules": "commonjs"
}
]
],
"plugins": ["angularjs-annotate"]
}
UPDATE!!
Seems that it comes from babel transpiling.
Babel added: "use strict";
. That's why my code failed