问题描述
我在项目中添加了一个新的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 modulesNote: The code generator has deoptimised the styling of "D:/path/to/project/node_modules/ramda/dist/ramda.js" as it exceeds the max of "100KB".
是什么意思?我需要采取一些措施吗?
What does it mean? Do I need to take some action?
推荐答案
这与Babel编译器的compact
选项有关,该命令""不包括多余的空格字符和行终止符.当设置为'auto 在输入大小> 100KB时,compact设置为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"的最大值时,“代码生成器已取消优化[某些文件]的样式".意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!