jeudi 14 novembre 2019

Vue-CLI build number - does it exist and how could it be used in a Vue app itself?

I have a Vue app being built for production deployment using Vue CLI.

I would like to include a typical incrementing build number in the application, so that I and testers can be sure we are testing the correct exact build. I would like to use it in the application in at least two ways a) to display it to a tester, and b) to included it in bug-tracking API calls e.g. to Sentry.io.

Currently I have to look at the hash on the app.XXXX.js and compare that. While this does uniquely identify the build, it's not sequential, is different for the CSS/JS/vendors etc and would be difficult to use in the codebase.

I'm happy to write a build wrapper script which manages the number and injects it into the build if that's what it takes.

The command I'm currently using is e.g.

npx vue-cli-service build --mode staging

Aucun commentaire:

Enregistrer un commentaire