Search code examples
webpackgit-revision

Getting git-revision hash with webpack


I'm trying to create archive with webpack with suffix by git-revision. Could you tell me please what is good way to do it?


Solution

  • You can get git revision in webpack in this way:

    var childProcess = require('child_process'),
    VERSION = childProcess.execSync('git rev-parse HEAD').toString();