What does “The code generator has deoptimised the styling of [some file] as it exceeds the max of ”100KB“” mean?

前端 未结 9 1441
失恋的感觉
失恋的感觉 2020-11-30 19:18

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

Now I get this message from webpack,

build modulesNote: The code generator

9条回答
  •  Happy的楠姐
    2020-11-30 19:32

    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.

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

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

提交回复
热议问题