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

Enhancements: Improve CommonChunksPlugin with Initial Scaffold #95

Closed
evenstensberg opened this issue Mar 27, 2017 · 3 comments
Closed
Assignees

Comments

@evenstensberg
Copy link
Member

**Mentioned on Twitter by Addy Osmani & "necolas" **

Do you want to request a feature or report a bug?

https://twitter.com/addyosmani/status/845317139959443456

What is the current behavior?

On rebuilds, a module changes hashes which means its being rebuilt, even though it hasn't changed.

What is the expected behavior?

We should make hashes not changed if the module hasn't either.

Sure. He meant that he had multiple chunks where when he would do a new build even if the code for those chunks didn't change the manifest for their entry chunk would and then the hashes for those entries also changed. Meant long term caching basically broke.

Sean covered a workaround in his post

  1. A new CommonsChunk with minChunks infinity and name not equalling a entry chunk (this extracts the runtime into its on entry chunk with no modules)

  2. Use OccurenceOrderPlugin to sort ids

  3. Use whatever Commons chunk strategy you want on top to accomplish vendor caching

  4. Use the recordsPath property to create a hard source control of your previous builds module ids so that they do not change when you run a new build or update your app code.

If this is a feature request, what is motivation or use case for changing the behavior?

Feature Request -> Better perf for scaffolds straight away.

@okonet
Copy link
Contributor

okonet commented Mar 28, 2017

Use OccurenceOrderPlugin to sort ids

This is deprecated in Webpack 2 AFAIK

@jouni-kantola
Copy link

jouni-kantola commented Mar 28, 2017

According to v2 docs OccurrenceOrderPlugin is enabled by default, so should probably not be in the config.
Ref: https://webpack.js.org/guides/migrating/#occurrenceorderplugin-is-now-on-by-default

@evenstensberg
Copy link
Member Author

I think this was solved as apart of the initial generator at #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants