Skip to content

support webpack5 new library type 'module' #427

Closed

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?

Activity

  1. valscion commented on Mar 26, 2021

    @valscion
    Collaborator

    Thanks for opening an issue! PR is welcome ☺️

  2. g3tr1ght commented on Jul 29, 2021

    @g3tr1ght
  3. kiranbayram commented on Mar 22, 2022

    @kiranbayram

    @valscion Do you have any pointers how this can be implemented? I'd try to help if i can

  4. Airkro commented on Mar 24, 2022

    @Airkro
  5. opeologist commented on Apr 27, 2022

    @opeologist

    any update on this? would love to analyze these types of bundles

  6. ml1nk commented on Nov 18, 2022

    @ml1nk

    I tried changing the sourceType but it didn't work. I think the data structure changes somewhat.

  7. dbrenot-pelmorex commented on Dec 22, 2022

    @dbrenot-pelmorex

    Heads up that this is still an issue.

  8. valscion commented on Dec 22, 2022

    @valscion
    Collaborator

    Anyone who wants to can take a stab at fixing this with a PR ☺️

  9. Zaokret commented on Feb 7, 2023

    @Zaokret

    I'll take a stab at this.

  10. locked and limited conversation to collaborators on Feb 23, 2023
  11. converted this issue into a discussion #587 on Feb 23, 2023
  12. added a commit that references this issue on Jan 8, 2025
    70a2f00
  13. added 3 commits that reference this issue on Feb 10, 2025
    a51ffe6
    9e3558e
    a0199c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions