“代码生成器已取消优化 [某个文件] 的样式,因为它超过了“100KB"的最大值"是什么意思?意思是? [英] What does "The code generator has deoptimised the styling of [some file] as it exceeds the max of "100KB"" mean?

查看:15
本文介绍了“代码生成器已取消优化 [某个文件] 的样式,因为它超过了“100KB"的最大值"是什么意思?意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中添加了一个新的 npm 包,并且在我的一个模块中需要它.

I added a new npm package to my project and require it in one of my modules.

现在我从 webpack 收到这条消息,

Now I get this message from webpack,

build modules注意:代码生成器对D:/path/to/project/node_modules/ramda/dist/ramda.js"的样式进行了去优化,因为它超过了100KB"的最大值.

什么意思?我需要采取一些措施吗?

What does it mean? Do I need to take some action?

推荐答案

这与 Babel 编译器的 compact 选项有关,该选项不包括多余的空白字符和行终止符.当设置为 'auto' 时,compact 在输入大小大于 100KB 时设置为 true." 默认情况下,它的值为auto",因此这可能是您收到警告消息的原因.请参阅 Babel 文档.

This is related to compact option of Babel compiler, which commands to "not include superfluous whitespace characters and line terminators. When set to 'auto' compact is set to true on input sizes of >100KB." By default its value is "auto", so that is probably the reason you are getting the warning message. See Babel documentation.

您可以使用 查询参数从 Webpack 更改此选项.例如:

You can change this option from Webpack using a query parameter. For example:

loaders: [
    { test: /.js$/, loader: 'babel', query: {compact: false} }
]

这篇关于“代码生成器已取消优化 [某个文件] 的样式,因为它超过了“100KB"的最大值"是什么意思?意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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