vue-cli-plugin-build-version

1.0.6 • Public • Published

what is this

this is a vue-cli-plugin that to generate version.json file for vue-cli project.

the content should like this

{
  "date": "2020-09-23 11:11:11", // last build date
  "cvs": "git", // cvs type
  "rev": "a4f56gf" // cvs short HEAD rev
}

how to use it

  1. install from you node package manager.

    npm install vue-cli-plugin-build-version

    or

    vue add vue-cli-plugin-build-version
  2. put below config in vue.config.js

    pluginOptions: {
      buildVersion: {
        path: require('path').resolve('dist'), // build root dir
        env: require('process').env, // env obj
        cvs: 'git', // cvs type, git or svn
        versionPath: '' // version file parent dir, empty string for default
        name: '', // version file name, empty string for default
      }
    }
  3. put below config in package.json scripts fields

    "buildVersion": "vue-cli-service build-version"
  4. run npm run buildVersion

Change log

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i vue-cli-plugin-build-version

    Weekly Downloads

    140

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    8.01 kB

    Total Files

    8

    Last publish

    Collaborators

    • yinzhenyu