Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of webpack array configs #394

Merged
merged 2 commits into from
Nov 12, 2020

Commits on Nov 11, 2020

  1. Fix handling of webpack array configs

    When trying to analyze a stats.json for a webpack bundle generated off
    of an array webpack.config.json webpack-bundle-analyzer was throwing:
    
    Could't analyze webpack bundle:
    TypeError: Cannot read property 'assets' of undefined
    
    This bug was probably introduced in
    webpack-contrib#376
    
    Example webpack config to generate a stats.json file that causes the
    crash:
    
    ```js
    function getConfig({ config }) {
      return {
        mode: 'production',
        entry: './src/index.js',
        performance: {
          hints: 'warning',
        },
        optimization: {
          minimize: true,
        },
        output: {
          filename: `${config}-[name].js`,
          chunkFilename: `${config}-chunk-[name].js`,
          path: `${__dirname}/`,
        },
      };
    }
    
    module.exports = [{ config: 'config-1' }, { config: 'config-2' }].map(getConfig);
    ```
    ctavan committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    4d7f0f9 View commit details
    Browse the repository at this point in the history
  2. Fix changelog entry

    ctavan committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    303d801 View commit details
    Browse the repository at this point in the history