问题描述
当我运行任务时,它会继续给我
注意:
lockquote
运行babel:dist(babel)任务
[BABEL]注意:代码生成器已经优化了common.js的样式,因为它超过了100KB的最大值。
[BABEL]注意:代码生成器已经对detailjs的样式进行了优化,因为它超过了100KB的最大值。
这不是一个错误,它可以帮助你解决这个问题。你的代码。 Babel报告文件 common.js
和 detailjs
的大小大于100 KB,这意味着Babel将会不要尝试生成漂亮的代码输出。 compact
选项改变了这种行为,并且有三个有效值: auto
,这是默认的,它禁用相当一代的文件大小超过100 KB; true
,它总是禁用漂亮的一代;和 false
,它总是生成漂亮的代码。
你可以传递 compact
选项加入到Babel中,值为 true
,以防止你看到的信息出现,但这也会阻止Babel生成漂亮的输出。
如果您需要相当出色的表现,并且想要阻止您看到的警告,您可以设置 compact
到 false
,它总是会生成漂亮的代码。
When i am running grunt babel task, its keep giving me
Note :
Could someone please tell me why this happens and what is the fix for this ?
This is not a bug in your code. Babel is reporting that the files common.js
and detailjs
are greater than 100 KB in size, which means that Babel will not try to generate "pretty" code output. The compact
option changes this behavior, and has three valid values: auto
, the default, which disables pretty generation of files greater than 100 KB in size; true
, which always disables pretty generation; and false
which always generates pretty code.
You can pass the compact
option to Babel with a value of true
to prevent the message you are seeing from appearing, however this will also prevent Babel from generating pretty output.
If you want pretty output, at the penalty of performance, and want to prevent the warning you are seeing, you can set compact
to false
, which will always generate pretty code.
Note that while Babel considers this code "pretty", it may not satisfy your ideals of beautiful code.
这篇关于咕噜巴贝尔100 kb造型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!