Commit 2f11ffe
Create rscWebpackConfig.js for the RSC bundle
Derives from serverWebpackConfig(true) — inherits target:'node',
libraryTarget:'commonjs2', CSS filtering, and all server transforms.
Adds three RSC-specific pieces:
1. RSC WebpackLoader pushed into the babel rule's use array (runs
before babel per right-to-left order) to detect 'use client'
directives in raw source and replace client exports with
registerClientReference proxies.
2. react-server resolve condition so React's RSC-specific entry
points are used.
3. react-dom/server aliased to false (RSC bundles generate Flight
payloads, not HTML; importing react-dom/server causes a runtime
error).
Loader placement follows Pro dummy pattern (push into rule.use) per
docs/oss/migrating/rsc-preparing-app.md:167-195. NOT marketplace's
enforce:'post' which runs after transpilation and can miss directive
AST nodes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 325f3e3 commit 2f11ffe
1 file changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments