Skip to content

support webpack5 new library type 'module' #427

@cncolder

Description

@cncolder

Issue description

Currently, It cannot parse properly when webpack5 config library type to module. Because webpack5 append some codes like export {a, b, c} to the end of the bundle.

const config: webpack.Configuration = {
  output: {
    libraryTarget: 'module',
  },
  experiments: {
    outputModule: true,
  },
  plugins: [new BundleAnalyzerPlugin({ analyzerMode: 'static' })],
}

Technical info

  System:
    OS: macOS 11.2.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 3.01 GB / 24.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.11.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  npmPackages:
    case-sensitive-paths-webpack-plugin: 2.4.0 => 2.4.0 
    fork-ts-checker-webpack-plugin: 6.2.0 => 6.2.0 
    webpack: 5.28.0 => 5.28.0 
    webpack-bundle-analyzer: 4.4.0 => 4.4.0 
    webpack-cli: 4.5.0 => 4.5.0 
    webpack-merge: 5.7.3 => 5.7.3 

Debug info

How do you use this module? As CLI utility or as plugin?

plugin

If CLI, what command was used? (e.g. webpack-bundle-analyzer -O path/to/stats.json)

If plugin, what options were provided? (e.g. new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true }))

new BundleAnalyzerPlugin({ analyzerMode: 'static' })

What other Webpack plugins were used?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions