https://github.com/yinzhenyu-su/vue-cli-plugin-build-version
Generate a build.version file in vue-cli project after project build.
https://github.com/yinzhenyu-su/vue-cli-plugin-build-version
buildversion vue vue-cli
Last synced: 5 months ago
JSON representation
Generate a build.version file in vue-cli project after project build.
- Host: GitHub
- URL: https://github.com/yinzhenyu-su/vue-cli-plugin-build-version
- Owner: yinzhenyu-su
- License: mit
- Created: 2020-09-23T01:25:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-19T03:14:54.000Z (about 5 years ago)
- Last Synced: 2025-10-19T02:26:35.168Z (8 months ago)
- Topics: buildversion, vue, vue-cli
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# what is this
this is a vue-cli-plugin that to generate version.json file for vue-cli project.
the content should like this
```js
{
"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.
```js
npm install vue-cli-plugin-build-version
```
or
```js
vue add vue-cli-plugin-build-version
```
2. put below config in **vue.config.js**
```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
```json
"buildVersion": "vue-cli-service build-version"
```
4. run `npm run buildVersion`
## Change log