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

ModuleConcatenationPlugin is setting modules[].reasons[].moduleId to null in some cases #8062

Closed
joeljeske opened this issue Sep 20, 2018 · 4 comments

Comments

@joeljeske
Copy link

Bug report

What is the current behavior?

It would appear that when using ModuleConcatenationPlugin (which is default for mode = production), that the modules that it concatenated do not properly have module ids in the output stats. More specifically, if a reason for given module is from a module that has been concatenated, then the moduleId of that reason is null. I would not expect that to be the case.

If the current behavior is a bug, please provide the steps to reproduce.

Reproduction Project:
https://github.com/joeljeske/webpack-module-concatenation-plugin-issue

What is the expected behavior?

Every reason for module should have a moduleId that corresponds with the id of a module

Other relevant information:
webpack version: 4.19.1
Node.js version: v8.11.3
Operating System: MacOS 10.13.4
Additional tools: N/A

@sokra
Copy link
Member

sokra commented Sep 21, 2018

Concatenated modules don't have ids. All modules have identifiers.

@joeljeske
Copy link
Author

How would you recommend that I traverse the dependency tree using the stats? Is there any way to do this?

@sokra
Copy link
Member

sokra commented Sep 24, 2018

You can use moduleIdentifier and identifier. This is always set and unique.

Best build a Map<string, Module> with identifer as key.

@alexander-akait
Copy link
Member

Answer above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants