-
Notifications
You must be signed in to change notification settings - Fork 18
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
🐛 Fix chunk.getModules() webpack 5 deprecation warning #28
base: master
Are you sure you want to change the base?
Conversation
(node:38087) [DEP_WEBPACK_CHUNK_GET_MODULES] DeprecationWarning: Chunk.getModules: Use new ChunkGraph API
On the Docusaurus PR (facebook/docusaurus#4089), we'll be using my local fork Deploy preview at https://deploy-preview-4089--docusaurus-2.netlify.app/ |
@@ -247,7 +249,7 @@ class ReactLoadableSSRAddon { | |||
|| ''; | |||
this.getEntrypoints(this.stats.entrypoints); | |||
|
|||
this.getAssets(this.getMinimalStatsChunks(compilation.chunks)); | |||
this.getAssets(this.getMinimalStatsChunks(compilation.chunks, compilation.chunkGraph)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case this isn't present for webpack 4
this.getAssets(this.getMinimalStatsChunks(compilation.chunks, compilation.chunkGraph)); | |
this.getAssets(this.getMinimalStatsChunks(compilation.chunks, compilation.chunkGraph || null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think chunkGraph is present in webpack4, but not sure to understand why this call is needed? Do we want null instead of undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. Just trying to avoid strict mode madness where possible, but this might not be entirely needed.
Summary
Follow-up of the work of @RDIL for Docusaurus 2 to support Webpack 5 (facebook/docusaurus#4089)
We have a Webpack 5 deprecation warning:
chunk.getModules()
is deprecated and should be replaced by thechunkGraph
API.To help review, wasn't able to find doc about the new
ChunkGraph
API, but it seems it is equivalent, asgetModules()
use this new API now and just add a deprecation warningWhy
Support Webpack 5 without warnings
Checklist
errors
orwarnings
approved terminology
unit tests
, if apply.Emojis for categorizing pull requests:
🐛 Bug fix (
:bug:
)