SKILL.md
$27
Runtime-Bundle Model
- Runtime bundles are built by
next-runtime.webpack-config.js(rspack) viataskfile.jsbundle tasks.
- Bundle selection occurs at runtime in
src/server/route-modules/app-page/module.compiled.jsbased onprocess.envvars.
- Variants:
{turbo/webpack} × {experimental/stable/nodestreams/experimental-nodestreams} × {dev/prod}= up to 16 bundles per route type.
define-env.tsaffects user bundling, not pre-compiled runtime internals.
process.env.Xchecks inapp-render.tsxare either replaced by DefinePlugin at runtime-bundle-build time, or read as actual env vars at server startup. They are NOT affected by the user's defines fromdefine-env.ts.
- Gotcha: DefinePlugin entries in
next-runtime.webpack-config.jsmust be scoped to the correctbundleType(e.g.apponly, notserver) to avoid replacing assignment targets innext-server.ts.
Related Skills
$dce-edge- DCE-safe require patterns and edge constraints
$react-vendoring- entry-base boundaries and vendored React
$runtime-debug- reproduction and verification workflow