使用 webpack 获取 git-revision 哈希 [英] Getting git-revision hash with webpack

查看:29
本文介绍了使用 webpack 获取 git-revision 哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有 git-revision 后缀的 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?

推荐答案

你可以通过这种方式在webpack中获取git修订:

You can get git revision in webpack in this way:

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

这篇关于使用 webpack 获取 git-revision 哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆