diff --git a/CHANGELOG.md b/CHANGELOG.md index 93b90d4..cd5a884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index e60ed53..9027843 100644 --- a/README.md +++ b/README.md @@ -141,11 +141,9 @@ Through the `git` command below, you can list all branches containing the specif git branch -r --contains ``` -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: @@ -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) + [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 diff --git a/README_ZH.md b/README_ZH.md index c793244..6544df2 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -143,11 +143,9 @@ export default defineConfig({ git branch -r --contains ``` -查看 [CHANGELOG](./CHANGELOG.md) - -### outputFile配置项说明 +### `outputFile` 配置项说明 -如需启用可设置为true,会在相对构建目录(vite默认为dist,nuxt3默认为.output/public)下创建路径为“.well-known/version”的文件,内容为当前版本号。 +如需启用可设置为 `true`,会在相对构建目录(`vite` 默认为 *dist*,`nuxt3` 默认为 *.output/public*)下创建路径为 `.well-known/version` 的文件,内容为当前版本号。 也可以设置为一个函数,该函数接收版本号作为参数,并返回一个对象,以便自行定义生成的内容信息,例如: @@ -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) + [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 diff --git a/package.json b/package.json index 19a6007..d863f7d 100644 --- a/package.json +++ b/package.json @@ -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",