Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

WIP: webpack: Automatically generate 'vendor' chunk #798

Closed
wants to merge 1 commit into from

Conversation

rmader
Copy link
Contributor

@rmader rmader commented Jul 18, 2019

Webpack 4 brought some handy new features, one of them being chunk
handling. It allows us to now easily split all vendor code automatically
into a 'vendor' chunk and also allows us to further differentiate between
packages, so we can e.g. create one chunk for all leaflet related stuff.

Requires liqd/adhocracy4#360

@rmader
Copy link
Contributor Author

rmader commented Jul 18, 2019

So what this archives is:

  1. Simplify our webpack setup. Whenever you need some js, just include it in another js file or throw in into the adhocracy4 endpoint -> it will automatically go to vendor if it's imported from some nodejs package.
  2. Avoid duplicate downloads: this branch reduces the combined js size at many place, most prominently the combined size of adhocracy4 and vendor. As we include these two basically everywhere, that's an instant win
  3. makes it much easier to add special endpoints share code by declaring extra chunks, like the leaflet one used by the different maps.
  4. The risk of breaking stuff should be fairly low I take that back, there are some issues :)

@rmader rmader changed the title webpack: Automatically generate 'vendor' chunk WIP: webpack: Automatically generate 'vendor' chunk Jul 18, 2019
@rmader rmader force-pushed the rm-2019-07-webpack-chunk-optimization branch from 6c67bf9 to c51de00 Compare July 18, 2019 15:53
Webpack 4 brought some handy new features, one of them being chunk
handling. It allows us to now easily split all vendor code automatically
into a 'vendor' chunk and also allows us to further differentiate between
packages, so we can e.g. create one chunk for all leaflet related stuff.
@rmader rmader force-pushed the rm-2019-07-webpack-chunk-optimization branch from c51de00 to db4089a Compare July 18, 2019 16:17
@fuzzylogic2000 fuzzylogic2000 removed their request for review September 24, 2019 10:56
@rmader rmader closed this Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant