-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
splitChunks : none of the options is self-explanatory and documentation is cryptic #2103
Comments
We are in progress with adding I know this isn't a life saver answer, just to give you the rough idea on whats going on with |
I appreciate the answer. I read on reddit that the release of 4.x with regards to documentation is something that "was not supposed to happen" so looking forward for the updated documentation so we can improve our configs incrementally. |
The PR that got merged addresses some of the bullet points in the OP but not all of them. Re-open? (I'm particularly interested in more details on |
Test's regexp can be both directory and file like any regexp, you provide what to match against, but how do you want to split chunks from your single file? That doesnt make much sense, can you please (@thw0rted) or anyone willing open a separate issue in a format of [ ] things unclear with detail and we will go through them together and update the docs where necessary. I will gladly try to help as much and if necessary we involve more people |
The OP in this issue is pretty clear about what lacks detail. I can open a separate issue if it helps but I'll capture some thoughts here:
I think the complaint was made elsewhere that the docs kind of presuppose that you've spent time with the predecessor (CommonsChunk) and if you don't already understand how webpack handles chunks, dynamic loading, etc, you don't have the context you need to understand SplitChunks. Maybe some of the shortfalls I list above would be addressed to some extent with a few opening paragraphs describing how modules relate to chunks, types of chunks, splitting best practices, etc. I've done some reading in the past but I still find the whole thing kind of confusing. Good per-argument docs and examples can get me to "it works" but a deeper background could help me actually understand what's going on. |
@thw0rted Can you please give me some hints about the third point if you might have understood it? |
If you mean, do I now understand the use of the |
I know this ticket might not conform with the issue creation policy but I will try to compile a list of questions here hoping that they can be addressed (I am willing to make PRs to improve the documentation)
1. optimization.runtimeChunk
I guess this makes sense if you have more than one entry points. In any other case, the appropriate value should be
'false'
, correct?2. optimization.occurrenceOrder
Does this option still exist? (not found in documentation using search)
3. optimization.namedChunks
Same as above.
4. maxInitialRequests
I had cases when a cacheGroup was not generating a file until I increased the default maxInitialRequests value to something like "10". I have no idea why that is.
(and most importantly)
5. test
I am migrating a setup with which we were using simple strings to target individual node_modules which we wanted in a separate generated file to split the end result of vendors in smaller files. Some of the test rules don't seem to be doing what I think they should - is there a way to debug this? Can I just use a simple string like "moment.js" or should I target the parent directory using a regexp :
/[\\/]moment[\\/]/
.6. chunks
The documentation of the options "initial", "async" and "all" is just a repetition of the option word itself. Desperately looking for a tangible example.
This issue was moved from webpack/webpack#7203 by @montogeek. Original issue was by @gkatsanos.
The text was updated successfully, but these errors were encountered: