Skip to content
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

Include version during build #11249

Open
ShareinSK opened this issue Jul 27, 2021 · 2 comments
Open

Include version during build #11249

ShareinSK opened this issue Jul 27, 2021 · 2 comments
Labels

Comments

@ShareinSK
Copy link

How to include the build version as a meta when running npm run build using the version in package.json

Right now I have a env variable REACT_APP_VERSION_INFO=

Inside the index.html, I have added <meta name="version-info" content="%REACT_APP_VERSION_INFO%" />

The only overhead is I have to update the version in the env file in addition to the usual version update in package.json.

@graup
Copy link

graup commented Aug 30, 2021

You could set that environment variable automatically. I our build scripts we use something like

REACT_APP_VERSION=`git describe --tags` react-scripts build

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants