-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Added deepChildren support from ArcEglos' pull request #5764
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
Conversation
I see that the new test is failing in node v4. I'm working to resolve the issue. |
destructuring not supported in Node v4
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Sweet! I am so waiting for this feature. |
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.
Also add an test case in test/configCases or test/statsCases
lib/optimize/CommonsChunkPlugin.js
Outdated
|
||
return true; | ||
}); | ||
let affectedChunks = []; |
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.
Make it a Set
## Uncompressed | ||
|
||
``` | ||
Hash: [1mfd4796594a8274a0759b[39m[22m |
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.
This should not include the color special chars. Try to pass --no-colors
in examples/build-common.js to fix it.
deepChildren: true, | ||
}) | ||
] | ||
}; |
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.
Could you also a async
mode to this example? You can pass multiple configurations to include both modes in a single example.
* using set instead of array * example of async use case
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.
Code looks good, example need to be fixed.
imports[1].default.should.be.eql("reuse"); | ||
done(); | ||
}).catch(e => { | ||
done(); |
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.
Pass the error to the done callback, elsewise errors are ignored.
@@ -0,0 +1 @@ | |||
require("../build-common"); |
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.
add global.NO_TARGET_ARGS = true;
before this line to disable the default and allow multiple configurations.
* fixed README.md * pass error to done in test
I added a pull request to the documentation for this feature. |
Thanks |
@sokra are you going to cook one more minor release before webpack 4? |
Can someone please look at #4392, specifically my question. |
What kind of change does this PR introduce?
Feature
Did you add tests for your changes?
Yes
If relevant, link to documentation update:
webpack/webpack.js.org#1625
Summary
If you use the CommonsChunkPlugin with the children flag enabled it currently only cares about direct children. This change makes it so it cares about all children that are not required from somewhere else than the common chunk.
#3981
Does this PR introduce a breaking change?
If the config deepChildren isn't set the behavior stays the same as before, it only changes if the flag gets set.
Other information
Thanks to Florian Scholz (ArcEglos) for doing all the work.
#4255