Last active
September 14, 2022 07:50
-
-
Save cyberfly/772827f3c8ccc05b8a40a492300d14cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Layout = ({ children }) => { | |
useEffect(() => { | |
// set version | |
window.APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION; | |
}, []); | |
} | |
export default Layout; | |
// now we can check at console APP_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"dev": "export NEXT_PUBLIC_APP_VERSION=$(git rev-parse HEAD) && next dev", | |
"build": "next build", | |
"export": "export NEXT_PUBLIC_APP_VERSION=$(git rev-parse HEAD) && next build && next export", | |
"start": "next start", | |
"lint": "next lint" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment