🐛 add missing entrypoints to origins #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add missing entrypoints to the origins list
Why
Fixes #8
Background:
Extract from the webpack.config.js
While investing ways of doing SSR + Code Splitting on a large code base that predates framework like Next.js or React Loadable, I came across React Loadable and your Addon.
After a bit a tinkering I was able to first do a "route level" code splitting with SSR that worked. But the chunks generated shared a lot of code and where pretty big, defeating the purpose of code splitting for us.
I looked for ways to reduce the duplication of dependencies across the chunks and came across this article webpack bits: Getting the most out of the CommonsChunkPlugin()
That's when I added this part:
and it produced the expected result: the main bundle (entry point) was bigger and the chuncks much smaller.
The issue I faced then is that, when running
react-loadable-ssr-addon
webpack plugin, the generated manifest was not listing mymain
entrypoint in theorigins
anymore for some reason.That's when I found the issue linked above and the proposed solution, I tested it out and it worked like a charm.
I did not investigate much further, test are passing but I did not add new ones for this use case.
Checklist
errors
orwarnings
approved terminology
unit tests
, if apply.