Can you set NODE_ENV
in your package script? Next should respond to this (https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#environment-variable-load-order).
run_prod: NODE_ENV=production next dev
Do be aware that you can't really get a production bundle out of next dev
so you'd need to do next build && next start
to really be sure everything works... but you'd at least get your faster dev cycle this way by avoiding the constant stop start of build && start
.