.env.local.production May 2026
NODE_ENV=production npm run build But you cannot use your live production database or live payment API keys on your laptop. You need a local "production-like" environment.
The difference is purely syntactical. Most modern frameworks prefer the former ( env.production.local ), but legacy systems or custom CI/CD pipelines might recognize the latter. If you have .env and .env.production , why introduce a third file? The answer lies in sensitive, environment-specific configuration . .env.local.production
You need to run a production build on your local machine: NODE_ENV=production npm run build But you cannot use