-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev - Bundles Contain Duplicate Code #877
Comments
It generates a build per each page (the interactive bits). To fix this, you would have to dig into Antwar around here. PRs welcome. 👍 |
I think I know how to handle this now. Basically the interactive build has to treat preact/preact-dom as externals (cuts most of the size). preact/preact-dom have to be bundled separately by the main config and then wired to the template ( |
Great. However it's not just preact. > 95% of the code between these split points is the same. The only thing that differs is the rendering of the items in the sidebar and top nav depending on route. |
That would need a different approach entirely. |
Yeah, I guess. I tried looking at the code you linked, but I'm not sure I
entirely understand what's going on there.
Was looking to add PWA support to the site, but the caching of all of these
bundles might exceed the cache storage quota.
|
@bebraw is this something specific to this site, or more just related to how antwar's |
@skipjack It's a difficult one to fix but we can leave this open for now. I have a feeling treating Preact and its dependencies as externals at webpack configuration would solve most of this. |
I'm definitely interested in converting docs into a PWA, so keep me looped in or tagged if this ends up in another issue. |
The output of
npm run build
generates a bunch of.js
split points, and each of them seem to have a copy ofpreact
and other npm libs.I tried introducing
CommonsChunkPlugin
inwebpack.config
, but don't find any commons file being generated. This is pretty inefficient and perhaps loading a single commons bundle upfront would be better.@bebraw Any clue if this config comes from antwar side of things?
The text was updated successfully, but these errors were encountered: