For some strange reason I can't for the life of me compile "vendor" libraries with my build process.
Im getting this error: SyntaxError: <FILENAME> 'with' in strict mode
.
(where
<FILENAME>
is an actual existing filename)
The line that's failing is > 130928 | with (locals || {}) { (function(){
and its complaining about that with
. Bear in mind that this file is outside my control.
My .babelrc
file has this config.
{
"compact": true,
"plugins": [
"transform-runtime",
"undeclared-variables-check"
],
"presets": [
"es2015",
"stage-0"
]
}
I'm using babel 6, I know the general conscious is to use version 5, but no luck there either.
Not sure why this hasn't been answered already.
The es2015 preset (and, to my understanding, every babel preset) enables strict mode. Check out MDN's article on strict mode, specifically the section with header "Simplifying variable uses".
with
is illegal in strict mode.