1.0.7 • Published 5 months ago

vite-plugin-commit-hash v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Vite-Plugin-Commit-Hash

Mini-Plugin used to provide commit hash information to the project. This should work cross-framework just fine.

Installation

  1. pnpm i vite-plugin-commit-hash
  2. Load the plugin in your vite.config.js: import {CommitHashPlugin} from 'vite-plugin-commit-hash'; followed by plugins: [/*your other plugins*/, CommitHashPlugin({noPrefix:false,noVirtual:false})]

Usage

Import virtual:commit-hash in your codebase;

import CommitHash from 'virtual:commit-hash';
console.log(CommitHash); // -> Current Hash - with '-dirty' at the end if there's uncommitted work.

Example Config

import { sveltekit } from '@sveltejs/kit/vite';
import { CommitHashPlugin } from 'vite-plugin-commit-hash';
import type { UserConfig } from 'vite';

/** @type {import('vite').UserConfig} */
const config: UserConfig = {
	plugins: [sveltekit(), CommitHashPlugin({noPrefix:false,noVirtual:false})]
};

export default config;

Attribution

Developed by @ExponentialWorkload Licensed under the MIT License Slightly inspired by vite-plugin-git-revision

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago