vite-plugin-update-version-code
v0.0.4
Published
A Vite plugin that generates a `version.json` file with build time metadata.
Readme
vite-plugin-update-version-code
A Vite plugin that generates a version.json file with build time metadata.
📦 Installation
npm install vite-plugin-update-version-code ⚙️ Usage
In your vite.config.js:
import VersionPlugin from "vite-plugin-update-version-code";
defineConfig(({ command, mode }) => {
return {
plugins: [
VersionPlugin({
output: "dist/version.json", // 输出路径
overwrite: false // 是否保留原始文件
}),
]}
});📄 Output Example
{
"version": "2025-04-04T14:05:00.000Z",
}📝 License
MIT
