Last active
January 17, 2022 03:38
-
-
Save hungdoansy/4ef74299581ac0fe0b9d063be19413eb to your computer and use it in GitHub Desktop.
Display built time in front end projects (I use React to illustrate)
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
console.log(`Built time: %c${new Date(Number(process.env.REACT_APP_BUILT_TIME) * 1000)}`, "color: #bada55"); |
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
{ | |
"start": "cross-env REACT_APP_BUILT_TIME=$(date +%s) node scripts/start.js", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment