Currently, we're building the components grouping them into their respective "categories" by importing them into an index file and adding that index file as an entry point in webpack config, for example layout/index.js. Then when we npm run build:prod we end up having a lib/layout.js module which exports Layout by default and also all of its submodules.
The problem is that perhaps sometimes we don't need the whole layout category of components but importing some of it would add all of the layout size to our final bundle. Maybe, we can keep our current build but also add builds for each of the inner modules so that we end up with lib/layout.js but also with lib/layout/content.js in the final build.
Currently, we're building the components grouping them into their respective "categories" by importing them into an index file and adding that index file as an entry point in webpack config, for example layout/index.js. Then when we
npm run build:prodwe end up having a lib/layout.js module which exports Layout by default and also all of its submodules.The problem is that perhaps sometimes we don't need the whole layout category of components but importing some of it would add all of the layout size to our final bundle. Maybe, we can keep our current build but also add builds for each of the inner modules so that we end up with lib/layout.js but also with lib/layout/content.js in the final build.