javascript 如何处理来自 gulp-babel 的“代码生成器已取消优化样式”消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30879773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to handle 'code generator has deoptimised styling' message from gulp-babel
提问by sfletche
I've just employed gulp-babel
to my gulp file with the following
我刚刚使用gulp-babel
以下内容使用了我的 gulp 文件
var babel = require('gulp-babel');
return gulp.src(files.concat.js.myModule)
.pipe(babel())
.pipe(concat('myModule.js'))
.pipe(gulp.dest('path/to/js'));
...and I get the following Note
about deoptimising the styling in my gulp output:
...我得到以下Note
关于在我的 gulp 输出中取消优化样式的信息:
NOTE: The code generator has deoptimised the styling ... as it exceeds the max of "100KB"
Is this a problem?
Should I be handling this is some way?
这是一个问题吗?
我应该以某种方式处理这种情况吗?
回答by sfletche
Turns out the compact
option is set to auto
by default which removes "superfluous whitespace characters and line terminators [...] on input sizes >100KB".
原来该compact
选项设置为auto
默认设置,它删除了“输入大小 >100KB 上的多余空白字符和行终止符 [...]”。
If this is not what you want, you can set the compact
optionto false...
如果这不是您想要的,您可以将该compact
选项设置为 false...
.pipe(babel({compact: false}))