webpack-bundle-diff icon indicating copy to clipboard operation
webpack-bundle-diff copied to clipboard

Error upgrading to 1.2.0: childStats must be specified

Open djskinner opened this issue 3 years ago • 2 comments

The webpack.config.js in question does not export multiple configs, it is:

module.exports = (env, argv) => {
  return {
    target: 'web',
    [...]

The report is generated like this: generateReport(diff(baseBundleReport, headBundleReport))

I have tried generateReport(diff(baseBundleReport, headBundleReport, { childStats: 0 })), which gives the same error, and generateReport(diff(baseBundleReport, headBundleReport, { childStats: 'main' })) (and giving a name: 'main' to the single config returned in the webpack config), which yields a different error Invalid childStats value: main.

Any ideas? I got the impression I wouldn't need to specify the childStats param at all, but alas no.

djskinner avatar Nov 03 '22 17:11 djskinner

You're right, you shouldn't need to specify childStats in that case. I'll need to find some time to look into it. I don't think there's any reason you should need to upgrade to 1.2.X — are you okay sticking with 1.1.X in the meantime?

smikula avatar Nov 03 '22 18:11 smikula

Is the issue because the config exports a function?

are you okay sticking with 1.1.X in the meantime?

Yes, there is no immediate need to update other than keeping the dependency bot happy

djskinner avatar Nov 04 '22 09:11 djskinner