Created by: sw-yx
Hi
in connection with the community suggestion here: https://github.com/facebook/create-react-app/issues/2758
this is how it would work in react-scripts. i have only implemented this for production as I think it's probably not needed (possibly might cause some confusion if developing react at the same time) in development.
This PR results in the CRA bundle size going from 36 kb:
to 6kb (pardon the edited App.js text, i did not commit that lol):
and TTI should improve in actual deployed situation due to parallelized loading (not to mention caching benefits).
I have erred on the side of verbose with the comments for CRA users who may be unfamiliar with this plugin but am open to taking them out.