Commit b059759
committed
perf(devframe): dedupe immer between the node and browser builds
node/storage.ts and node/rpc-shared-state.ts reach
devframe/utils/shared-state through the same tsconfig path alias the
browser build's own utils/shared-state entry uses - two independent
rolldown graphs, so each was inlining its own copy of immer
(dist/storage-*.mjs and dist/shared-state-*.mjs, ~38 KB and ~33 KB).
Add devframe/utils/shared-state to the node build's deps.neverBundle
so it's externalized instead of resolved through the tsconfig path
alias; the emitted import resolves at runtime to the already-built
dist/utils/shared-state.mjs chunk via Node's package self-reference
(the client build runs first in the same tsdown invocation, so the
chunk exists on disk by the time the node build needs it). Verified
end-to-end: built dist/node/index.mjs's createStorage() round-trips
through the self-referencing import correctly, and immer's bytes now
appear in exactly one dist chunk.1 parent 512342d commit b059759
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
| |||
154 | 168 | | |
155 | 169 | | |
156 | 170 | | |
157 | | - | |
| 171 | + | |
158 | 172 | | |
159 | 173 | | |
160 | 174 | | |
| |||
0 commit comments