咕噜巴贝尔100 kb造型问题 [英] grunt babel 100 kb styling issue

查看:195
本文介绍了咕噜巴贝尔100 kb造型问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行咕噜巴贝尔任务时,它会继续给我



注意:

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 ,它总是会生成漂亮的代码。

注意,虽然Babel认为这段代码很漂亮,但它可能无法满足你漂亮的代码的理想。


When i am running grunt babel task, its keep giving me

Note :

Running "babel:dist" (babel) task [BABEL] Note: The code generator has deoptimised the styling of "common.js" as it exceeds the max of "100KB". [BABEL] Note: The code generator has deoptimised the styling of "detailjs" as it exceeds the max of "100KB".

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造型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆