[英]Babel Config "strict mode"
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
.我收到此错误:
SyntaxError: <FILENAME> 'with' in strict mode
。
(where
<FILENAME>
is an actual existing filename)(其中
<FILENAME>
是实际存在的文件名)
The line that's failing is > 130928 | with (locals || {}) { (function(){
失败的线路是
> 130928 | with (locals || {}) { (function(){
> 130928 | with (locals || {}) { (function(){
and its complaining about that with
. Bear in mind that this file is outside my control. > 130928 | with (locals || {}) { (function(){
和它的抱怨with
。记住这个文件不在我的控制范围内。
My .babelrc
file has this config.我的
.babelrc
文件有这个配置。
{
"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.我正在使用 babel 6,我知道一般有意识的是使用版本 5,但也没有运气。
Not sure why this hasn't been answered already.不知道为什么这还没有得到回答。
The es2015 preset (and, to my understanding, every babel preset) enables strict mode. es2015 预设(以及,据我所知,每个 babel 预设)启用严格模式。 Check out MDN's article on strict mode , specifically the section with header "Simplifying variable uses".
查看MDN 关于严格模式的文章,特别是标题为“简化变量使用”的部分。
with
is illegal in strict mode. with
在严格模式下是非法的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.