ModusCreateOrg/budgeting

I do not see the vender.js file in your online webside,how did u do this; because of webpack 2 (the tree shaking)?

Closed this issue · 1 comments

I do not see the vender.js file in your online webside,how did u do this; because of webpack 2 (the tree shaking)?

grgur commented

a specific vendor chunk wasn't created for this application. Here's why:

Vendors are embedded in the application core (entry)

There is a set of dependencies - code and libraries - needed to run this (or any other) app successfully. We let webpack figure out what that is.

All routes use code-splitting so they are in separate chunks. Whatever is not a separate chunk is application core.

Vendor chunks don't benefit from tree shaking

When you specify a vendor in a vendor chunk, then the entire package is bundled. E.g. if you reference react-router in vendors.js, then the entire package will be there. But if you let webpack figure out which modules to bundle automatically, it will leverage tree shaking and remove unused code'

Code used in multiple async chunks is extracted

To prevent duplication of code, we set CommonChunksPlugin to extract code used in two or more routes (async chunks) into a separate chunk. This is another alternative to decoupling vendors into a dedicated chunk