You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a nextjs project, create env files .env.development, .env.staging, .env.production . Create a "development", "staging", "production" configuration under your "build" target, run : nx run my-app:build:staging or nx run my-app:build --configuration=staging
Nextjs will build with .env.production file
Expected Behavior
should use correct env file determined by configuration
Although with Nx you can create any configuration you want, Next.js only allows (development, production and test) which is based on the NODE_ENV. If you are using our executors (not inferred targets) the NODE_ENV is automatically set if not previously set to:
development when running the dev server
production otherwise
This follows 1:1 with Next.js commands.
To override this behaviour, you need to set the NODE_ENV before running a command or adjust your environment variable names according to Next.js documentation.
Current Behavior
With a nextjs project, create env files .env.development, .env.staging, .env.production . Create a "development", "staging", "production" configuration under your "build" target, run :
nx run my-app:build:staging
ornx run my-app:build --configuration=staging
Nextjs will build with .env.production file
Expected Behavior
should use correct env file determined by configuration
GitHub Repo
can be seen with @latest nx setup
Steps to Reproduce
nx run my-app:build:staging
ornx run my-app:build --configuration=staging
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: