Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] How to use multiple commands #18

Open
chouchouji opened this issue Dec 5, 2024 · 3 comments
Open

[Feature] How to use multiple commands #18

chouchouji opened this issue Dec 5, 2024 · 3 comments

Comments

@chouchouji
Copy link
Contributor

No description provided.

@chouchouji
Copy link
Contributor Author

chouchouji commented Dec 5, 2024

@ZhongxuYang We should talk about how to realize this need. I think function is a better choice.

@ZhongxuYang
Copy link
Owner

ZhongxuYang commented Dec 5, 2024

Can you describe your design in pseudo-code? About input and command results.

@chouchouji
Copy link
Contributor Author

Can you describe your design in pseudo-code? About input and command 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,
      })
    ],
}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants