Isomorphic library bundles (target: "isomorphic"/"all") #14467
JasonKleban
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Does this still mean multiple fully-independent webpacking work though, right?
Related to React SSR, I am webpacking a library of common UI components which is reusable/isomorphic in both the browser client-side environment and the node server-side environment. Aside from the chunking logic which is platform-specific, most of the script code should be executable in both environments - there are no native operations for these components.
For a very basic webpack project, the emitted differences between the targets of "web" vs "node", the "production" build changes seem trivial, minification aside:
[id].js/main.js:
runtime.js:
The "development" mode emits are bigger but also seem mostly identical.
Is there a major reason why these emits couldn't be unified for an isomorphic single bundle output that is executable in either browser or node environments, perhaps with certain restrictions or warnings about use of native dependencies?
If this goal is in reach, is it limited to a change in the SplitChunksPlugin? Where is the code for that?
The benefit would be a single build CPU load for both consumers of SSR UI code.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions