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
I'd be nice to dynamically generate envs NEXT_PUBLIC_BUILD_VERSION, NEXT_PUBLIC_BUILD_ID and NEXT_PUBLIC_BUILD_TIME at build time, instead of generating using the generateEnvs.sh script
Describe the new feature
dynamically generate ENVs at build time
remove generating the envs from the generateEnvs.sh
## what
- add env for build version, build id and build time
- get the env from terminal or obtained from running npm script
- NEXT_PUBLIC_BUILD_VERSION: obtain from either
- terminal env `NEXT_PUBLIC_BUILD_VERSION`
- run npm script `npm run -s generateEnv`
- NEXT_PUBLIC_BUILD_ID
- terminal env `NEXT_PUBLIC_BUILD_ID`
- run npm script `npm run -s generateBuildId`
- NEXT_PUBLIC_BUILD_TIME
- terminal env `NEXT_PUBLIC_BUILD_TIME`
- run bash command `date +%s`
## how
- it will check the env value is set in the terminal before running
the `pnpm run dev` or `pnpm run build` command. If the value is NOT
set in the terminal then obtain it by running the npm script
- setting the env in `env` property
- check
- https://nextjs.org/docs/app/api-reference/next-config-js/env
## why
- this is to set the env in the config file instead of generating the
values and placing them in `.env.local` file; removes the need for
using `generateEnvs.sh` script
## where
- ./next.config.js
## usage
- run `pnpm run dev` or `pnpm run build`
## issue or pull request
- #435
Is your feature related to a problem?
I'd be nice to dynamically generate envs
NEXT_PUBLIC_BUILD_VERSION
,NEXT_PUBLIC_BUILD_ID
andNEXT_PUBLIC_BUILD_TIME
at build time, instead of generating using thegenerateEnvs.sh
scriptDescribe the new feature
generateEnvs.sh
Additional context
check
The text was updated successfully, but these errors were encountered: