title: How to add commit hash into reactjs vite.config.js
body: <p>I want to add commit hash into my react app. Normally, I added it with webpack but this project they are using vite.config.js. May I know how to inject commit hash into vite and how can I use it in react component.</p>
  <p>Thanks.</p>
  <p>const commitHash = require('child_process').execSync('git rev-parse --short HEAD').toString();</p>