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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 12:52:26  来源:igfitidea点击:

How to handle 'code generator has deoptimised styling' message from gulp-babel

javascriptgulpbabeljs

提问by sfletche

I've just employed gulp-babelto 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 Noteabout 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 compactoption is set to autoby 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 compactoptionto false...

如果这不是您想要的,您可以将该compact选项设置为 false...

.pipe(babel({compact: false}))