smashingboxes / web-boilerplate

A template for new front-end projects.
3 stars 2 forks source link

For production, split code between vendor, app, and manifest file, inline the manifest file #44

Closed leeallen337 closed 7 years ago

leeallen337 commented 7 years ago

WHY?

When building for production, we should utilize common chunks and split out the vendor files from the application for caching purposes. Additionally, since webpack inserts its own runtime code in every build, we should chunk that out as well, which we can inline to save an HTTP request.

WHAT?

Note: Since the chunkhash will only change when the chunk changes, the chunkhash for the vendor will only change if you pull in or decide not to use modules. Whereas the chunkhash for the bundle will update when the application code is changed.

leeallen337 commented 7 years ago

@greg5green @zachary-kuhn Any last comments/concerns/recommendations before I merge this in?

zachary-kuhn commented 7 years ago

You're awesome!