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

Chunk.hasEntryModule has been deprecated #8

Open
miusuncle opened this issue Jul 9, 2021 · 3 comments
Open

Chunk.hasEntryModule has been deprecated #8

miusuncle opened this issue Jul 9, 2021 · 3 comments

Comments

@miusuncle
Copy link
Contributor

[DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API

@joeldenning
Copy link
Member

I don't know of a way to check whether a chunk has entry modules without calling hasEntryModule(), and also don't have a strong desire to research it further since it's just a deprecation warning. If someone knows how to do so, please share.

@frehner
Copy link
Member

frehner commented Jul 9, 2021

I could be totally wrong on this, since webpack plugin docs are severely lacking, but it appears that you can do

- if (chunk.hasEntryModule()) {
+ if (compilation.chunkGraph.getNumberOfEntryModules(chunk) > 0) {

Based on what I'm seeing from this PR https://github.com/fqborges/webpack-fix-style-only-entries/pull/41/files

However, I think that's a webpack 5 only thing, so you would then need to do some sort of webpack version checking (or drop support for 4?) in order to use that. I think. Again, webpack docs are horrible.

@zepster
Copy link

zepster commented Oct 23, 2024

Created #23. I checked on our project - is ok. Also works with https://webpack.js.org/configuration/experiments/#experimentsbackcompat now (before failed)

@frehner thx for inside.

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

4 participants