
React Vendoring
If you're touching React vendoring in Next.js or working around the react-server layer boundary, you need this. Next.js doesn't pull React from node_modules for App Router. It vendors stable and experimental builds into packages/next/src/compiled/ during build. The tricky part is entry-base.ts: it's the only file compiled in the react-server layer, so all Flight server API imports must route through it or you'll hit "react-server condition must be enabled" errors in production (dev mode hides this). The skill covers the webpack aliasing setup, type declarations in $$compiled.internal.d.ts, and the boundary rules that will save you from runtime failures.
- skills.sh installs
- 945
- GitHub stars
- 139.5K
- last updated
- May 16, 2026
Install
$ npx -y skills add vercel/next.js --skill react-vendoring --agent claude-codeInstalls into .claude/skills of the current project.
Files
React Vendoring
Use this skill for changes touching vendored React, react-server-dom-webpack/*, or react-server layer boundaries.
App Router Vendoring
React is NOT resolved from node_modules for App Router. It's vendored into packages/next/src/compiled/ during pnpm build (task: copy_vendor_react() in taskfile.js). Pages Router resolves React from node_modules normally.
- Two channels: stable (
compiled/react/) and experimental (compiled/react-experimental/). The runtime bundle webpack config aliases to the correct channel viamakeAppAliases({ experimental }).
entry-base.ts Boundary
Only entry-base.ts is compiled in rspack's (react-server) layer. ALL imports from react-server-dom-webpack/* (Flight server/static APIs) must go through entry-base.ts. Other files like stream-ops.node.ts or app-render.tsx must access Flight APIs via the ComponentMod parameter (which is the entry-base.ts module exposed through the app-page.ts build template).
Sponsors
Details
- Repository
- github.com/vercel/next.js
- Categories
- Frontend Development, Cloud & Infrastructure
- First seen
- Apr 16, 2026