vite-plugin-version-mark
vite-plugin-version-mark copied to clipboard
[Feature] How to use multiple commands
@ZhongxuYang We should talk about how to realize this need. I think function is a better choice.
Can you describe your design in pseudo-code? About input and command results.
Can you describe your design in pseudo-code? About
inputandcommand results.
import {defineConfig} from 'vite'
import {vitePluginVersionMark} from 'vite-plugin-version-mark'
export default defineConfig(async () => {
const branch = await exec('git branch --show-current')
const hash = await exec('git rev-parse --short HEAD')
return {
plugins: [
vitePluginVersionMark({
// name: 'test-app',
// version: '0.0.1',
command: () => `${branch}-${hash}`,
// outputFile: true,
// ifGitSHA: true,
ifShortSHA: true,
ifMeta: true,
ifLog: true,
ifGlobal: true,
})
],
}})