A Vite and Nuxt plugin (v0.2.2) that automatically injects version information from package.json, git commit SHA, or custom commands into your application via console logs, global variables, meta tags, and static output files. It supports multi-command execution with custom format templates, aliases, timeouts, and fallbacks. Particularly useful for tracking deployed builds and debugging in production. Ships TypeScript types. Requires Vite or Nuxt 3.3+. Released under MIT.
npm install vite-plugin-version-markVerified import paths — ran on the pinned version, not inferred.
Minimal setup for Vite: enables short git SHA, meta tags, console log, and global variable injection.
Replace 'ifGitSHA: true' with 'ifShortSHA: true' in plugin config.
Migrate single 'command' string to new format: e.g., { commands: [{ command: 'git rev-parse --short HEAD', alias: 'sha' }] }.Access global variable like `__APP_VERSION__` after DOMContentLoaded if needed.
Ensure Nuxt 3.3+ is installed in your project.
Upgrade to v0.1.1+ or use a custom plugin to write version file.
Use `import { nuxtModule } from 'vite-plugin-version-mark/nuxt'` or load as module in nuxt.config.Use named import: `import { vitePluginVersionMark } from 'vite-plugin-version-mark'`.Ensure the Vite/Nuxt config file is at the project root, or explicitly set 'name' and 'version' in plugin options.