1.0.4 • Published 2 years ago

inject-vue-app-version v1.0.4

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

Installation

npm i -D inject-vue-app-version

How to inject a app version in vue application ?

  • Install inject-vue-app-version package from npm repository.
  • Create version.txt file in your app your_app > current_app_version > version.txt
  • Now import inject-vue-app-version package in vue.config.js file at line no.1.
    // vue.config.js
    require("inject-vue-app-version");
    ...
  • This package injects a VUE_APP_VERSION in to environment variables.
  • VUE_APP_VERSION consists a build time (current date and time) and git branch name (current branch name).
  • version.txt will get updated with VUE_APP_VERSION version value.
  • To print app version in browser, add this line console.log("%c" + process.env.VUE_APP_VERSION, "color:blue;font-size: 14px;font-weight: 700") in mounted or created hook of your entry vue file.
    // App.vue
    export default {
        name: 'app',
        components: {
            ...
        },
        created() {
            console.log("%c" + process.env.VUE_APP_VERSION, "color:blue;font-size: 14px;font-weight: 700")
        },
        mounted (){
            ...
        }
    }
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago