dce-edge

Installation
SKILL.md

DCE + Edge

Use this skill when changing conditional require() paths, Node-only imports, or edge/runtime branching.

DCE-Safe require() Pattern

Webpack only DCEs a require() when it sits inside the dead branch of an if/else whose condition DefinePlugin can evaluate at compile time.

// CORRECT - webpack can eliminate the dead branch
if (process.env.__NEXT_USE_NODE_STREAMS) {
  require('node:stream')
} else {
  // web path
}

What does NOT work:

Related skills
Installs
810
Repository
vercel/next.js
GitHub Stars
139.4K
First Seen
Feb 17, 2026