diff --git a/example/config/webpack.config.js b/example/config/webpack.config.js index 014f76758f..7a76d05a46 100644 --- a/example/config/webpack.config.js +++ b/example/config/webpack.config.js @@ -8,9 +8,9 @@ const config = require('../../package.json') const HtmlReplaceWebpackPlugin = require('html-replace-webpack-plugin') const GitRevisionPlugin = require('git-revision-webpack-plugin') const gitRevisionPlugin = new GitRevisionPlugin({ - commithashCommand: 'rev-list ' + config.version + '..HEAD --count' + commithashCommand: `rev-list v${config.version}..HEAD --count` }) - +const buildNumber = gitRevisionPlugin.commithash() module.exports = override( addBundleVisualizer({}, true), addWebpackModuleRule({ @@ -24,7 +24,8 @@ module.exports = override( new HtmlReplaceWebpackPlugin([ { pattern: '@@version', - replacement: gitRevisionPlugin.commithash() + replacement: + 'v' + config.version + (buildNumber > 0 ? `+${buildNumber}` : '') } ]) ) diff --git a/example/public/index.html b/example/public/index.html index 9003f941d8..b647d9718b 100644 --- a/example/public/index.html +++ b/example/public/index.html @@ -35,7 +35,7 @@ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> -