grunt babel 100 kb styling issue

2019-02-15 22:48发布

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 ?

1条回答
一夜七次
2楼-- · 2019-02-15 23:37

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.

查看更多
登录 后发表回答