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.modules is deprecated #14

Open
carlosrberto opened this issue Sep 26, 2017 · 3 comments
Open

Chunk.modules is deprecated #14

carlosrberto opened this issue Sep 26, 2017 · 3 comments

Comments

@carlosrberto
Copy link

I've the following output when using this plugin with Webpack 3:

$ rimraf build && webpack --config scripts/webpack.prod.config.js
(node:21262) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.
Total precache size is about 1.02 MB for 8 resources.
Hash: 8861e46ff46aac4d1de2
Version: webpack 3.2.0
Time: 4843ms
DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead
@benstevens48
Copy link

I also have this problem. I notice it's been fixed in the GitHub code 4 months ago, but the fix hasn't been published to npm. Any chance it could be published to npm?

@alexindigo
Copy link
Owner

@carlosrberto @benstevens48 I published 0.5.0 with latest commits. Sorry for the delay, life happened. :)
Please let me know if it works for you.
Thank you.

@benstevens48
Copy link

Hi @alexindigo ,
Thanks a lot for responding so quickly! I've tested it and it seems to work. However, I'm not sure exactly how everything works, but I wonder if not having the correct chunk ids is going to cause problems. I found another potential fix for this issue - to use webpack.NamedChunksPlugin with no arguments (undocumented, but very simple), together with explicitly naming any automatically generated lazy-loaded chunks using the special syntax (if you care about long-term caching these). (I'm also using new webpack.HashedModuleIdsPlugin()). Perhaps to avoid having to name these chunks explicitly one could use a modified version of your plugin to generate the chunk names as hashes for chunks without a name.

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