如何使每个Vue构建都包括在Vue应用中可访问的版本?

在Vue中,我希望能够获得当前的构建版本。最好采用YYYY-MM-DD-HH-MM格式(构建时间),而不是随机哈希(也可以)。

Here's how someone did this https://medium.com/@howitson/passing-generated-build-numbers-to-vue-app-f301e6b11877

Another idea: have a bash script which updates .env file with a line VUE_APP_BUILD_VERSION=... (is there any utility for this?) and then run npm run build

Any suggestions for simpler ways? Maybe get the .js file path and use that? /js/app.5e716dd8.js