Skip to content
Permalink
Browse files

Add build tag to bottom of page

  • Loading branch information...
april committed Jul 23, 2019
1 parent a01a647 commit 7a88c7544a49c4e86036e2da00fcf0fa095f234c
Showing with 12 additions and 1 deletion.
  1. +8 −0 config/webpack.config.js
  2. +4 −1 src/templates/index.ejs
@@ -5,12 +5,18 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const BrowserSyncWebpackPlugin = require('browser-sync-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const exec = require('child_process').spawnSync;
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const webpack = require('webpack');
const production = process.env.NODE_ENV === 'production';

// function that returns the github short revision
const revision = () => {
return exec('git', ['rev-parse', '--short', 'HEAD'], { encoding: 'ascii' }).stdout.trim();
}

// the many plugins used
const plugins = [
new CleanWebpackPlugin(
@@ -28,7 +34,9 @@ const plugins = [
constants,
configs,
csp: production ? constants.contentSecurityPolicy : constants.localContentSecurityPolicy,
date: new Date().toISOString().substr(0, 10),
production,
revision: revision(),
title: 'Mozilla SSL Configuration Generator',
template: 'src/templates/index.ejs'
}),
@@ -167,9 +167,12 @@
<li><a class="text-white" href="https://github.com/mozilla/ssl-config-generator#creating-templates">Supporting new software</a></li>
</ul>
</div>

</div>
</div>

<% if (htmlWebpackPlugin.options.production) { %>
<div class="w-100 d-none d-md-block pr-3 pb-1 small text-right text-muted"><a class="text-secondary" href="https://github.com/mozilla/ssl-config-generator/commit/<%= htmlWebpackPlugin.options.revision %>">build <%= htmlWebpackPlugin.options.revision %></a>, generated 2019-07-23</div>
<% } %>
</footer>
</body>
</html>

0 comments on commit 7a88c75

Please sign in to comment.
You can’t perform that action at this time.