-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[templates/nextjs] Add .env.*
support
#1741
Conversation
.env.*
support.env.*
support
.env.*
support.env.*
support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, see one comment and maybe PR description should be in its section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think we shouldn't use nextjs env package for this purpose, since these scripts are just node.js scripts, and mainly this package is recommended to be used for unit tests.
Please, take a look at other packages, like dotenv-flow, I think it was mentioned in a task description - If I start the app in production mode or connected, how the "loadEnvConfig" will automatically identify which .env file needs to be loaded? Probably, you need to set up NODE_ENV env variable, from my understanding
|
@sc-addypathania
|
packages/create-sitecore-jss/src/templates/nextjs/scripts/generate-config.ts
Show resolved
Hide resolved
Co-authored-by: Adam Brauer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@illiakovalenko FYI these comments should be addressed now with the |
Description / Motivation
Provide built-in support for environment variables which Nextjs provides OOTB i.e use
.env.*
files to load environment variables.Refer to : Nextjs environment variables support for more details.
Testing Details
Types of changes