
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
vite-plugin-git-commit-hash
Advanced tools
insert a variable GIT_COMMIT_HASH that can be printed out in your console
This plugin defines a global variable GIT_COMMIT_HASH
in your javascript/typescript. It is compatible with both commonjs and esm, with typescript declaration supplied.
pnpm add -D vite-plugin-git-commit-hash
import { defineConfig } from "vite";
import { gitCommitHashPlugin } from "vite-plugin-git-commit-hash";
export default defineConfig((config) => {
return {
plugins: [
/**
* ..your plugins
*/
gitCommitHashPlugin(),
]
};
});
/**
* use the variable GIT_COMMIT_HASH
*
* GIT_COMMIT_HASH is defined by vite-plugin-git-commit-hash
*/
console.info(GIT_COMMIT_HASH);
/**
* in any of your typescript declaration files, for example global.d.ts
* you will get typescript code autocompletion in your editor
*/
declare const GIT_COMMIT_HASH: string;
FAQs
a vite plugin that gets the latest git commit hash
The npm package vite-plugin-git-commit-hash receives a total of 823 weekly downloads. As such, vite-plugin-git-commit-hash popularity was classified as not popular.
We found that vite-plugin-git-commit-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.