next.js
d3169de7 - Collect modules with browser variants statically (#95200)

Commit
151 days ago
Collect modules with browser variants statically (#95200) Instead of hardcoding the list, we now automatically detect any `.browser` sibling and create a compiler alias for that module. Together with a linting rule, we'll ensure no future regressions are handled automatically (detection of conditional require and missing .browser sibling). This isn't the smoothest DX yet. Ideally we'd generate the list at Next.js compile time (i.e. before publishing) to avoid having to rerun a script (I'll follow-up). Generating the list during build time (next dev or next build) is just another tiny cost users would have to pay.
Author
Parents
Loading