Expected Behavior
import { createRequire } from 'node:module' is not injected unless allowed by an option.
Actual Behavior
import { createRequire } from 'node:module' is injected automatically.
Additional Information
Edge runtimes like workerd and vercel edge runtime does not support module.createRequire (workers docs, vercel edge runtime docs). It isn't possible to polyfill this function as well.
This means the code generated cannot be executed by those runtimes.
related: #1909, vitejs/vite#20983, vitejs/vite-plugin-react#929 (comment), wakujs/waku#1731