Skip to content

Commit

Permalink
docs: update readme (#14)
Browse files Browse the repository at this point in the history
* docs: update readme

* 0.1.1
  • Loading branch information
ZhongxuYang authored Oct 19, 2024
1 parent 3887875 commit f1537e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v0.1.1

* Support `outputFile` (by [@peerless-hero](https://github.com/ZhongxuYang/vite-plugin-version-mark/pull/13))

## v0.1.0

* Yarn switch to pnpm.
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,9 @@ Through the `git` command below, you can list all branches containing the specif
git branch -r --contains <COMMIT_SHA>
```

View [CHANGELOG](./CHANGELOG.md)

### outputFile Configuration Option

If you want to enable it, you can set it to true, and it will create a file with the path .well-known/version and the content of the current version number in the relative build directory (dist for vite and .output/public for nuxt3).
If you want to enable it, you can set it to `true`, and it will create a file with the path `.well-known/version` and the content of the current version number in the relative build directory (*dist* for `vite` and *.output/public* for `nuxt3`).

Alternatively, it can be set to a function that takes the version number as a parameter and returns an object. This allows you to define the content information generated, for example:

Expand All @@ -160,12 +158,15 @@ vitePluginVersionMark({
}),
```

With this configuration, a file named "custom/version.json" will be generated, and its content will be {"version":"${current version number}"}.
With this configuration, a file named `custom/version.json` will be generated, and its content will be `{"version":"${current version number}"}`.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=ZhongxuYang/vite-plugin-version-mark&type=Date)](https://star-history.com/#ZhongxuYang/vite-plugin-version-mark&Date)


View [CHANGELOG](./CHANGELOG.md)

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/vite-plugin-version-mark/latest.svg?style=flat&colorA=18181B
[npm-version-href]: https://www.npmjs.com/package/vite-plugin-version-mark?activeTab=versions
Expand Down
10 changes: 5 additions & 5 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ export default defineConfig({
git branch -r --contains <COMMIT_SHA>
```

查看 [CHANGELOG](./CHANGELOG.md)

### outputFile配置项说明
### `outputFile` 配置项说明

如需启用可设置为true,会在相对构建目录(vite默认为dist,nuxt3默认为.output/public)下创建路径为.well-known/version的文件,内容为当前版本号。
如需启用可设置为 `true`,会在相对构建目录`vite` 默认为 *dist*`nuxt3` 默认为 *.output/public*下创建路径为 `.well-known/version` 的文件,内容为当前版本号。

也可以设置为一个函数,该函数接收版本号作为参数,并返回一个对象,以便自行定义生成的内容信息,例如:

Expand All @@ -162,13 +160,15 @@ vitePluginVersionMark({
}),
```

如此配置便可以生成一个名为custom/version.json的文件,内容为 `{"version":"${当前版本号}"}`
如此配置便可以生成一个名为 `custom/version.json` 的文件,内容为 `{"version":"${当前版本号}"}`

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=ZhongxuYang/vite-plugin-version-mark&type=Date)](https://star-history.com/#ZhongxuYang/vite-plugin-version-mark&Date)


查看 [CHANGELOG](./CHANGELOG.md)

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/vite-plugin-version-mark/latest.svg?style=flat&colorA=18181B
[npm-version-href]: https://www.npmjs.com/package/vite-plugin-version-mark?activeTab=versions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-version-mark",
"version": "0.1.0",
"version": "0.1.1",
"description": "Automatically insert the version or git_commit_sha in your Vite/Nuxt project.",
"keywords": [
"vite",
Expand Down

0 comments on commit f1537e9

Please sign in to comment.