How to insert a Build Number or Timestamp at build time in AngularCLI

前端 未结 8 1000
故里飘歌
故里飘歌 2020-12-04 08:51

I want to have a timestamp or build number somewhere on my Angular2 App so I can tell if a user is using an old cached version or not.

How to do this with AngularCLI

8条回答
  •  旧巷少年郎
    2020-12-04 08:59

    If you want to log/display not only the version number but also information from git (like the hash, tag, etc) you can consider using a custom schematic for the angular-cli that I created. Adding it to your Angular 8+ Application is as simple as executing ng add @w11k/git-info

    For further Documentation and insights you can look at the documentation available at https://github.com/w11k/angular-git-info

提交回复
热议问题