Skip to content

Commit 905c978

Browse files
committed
Fix Dash-Industry-Forum#1521 - add banner with version, git sha1, build time and date to all minified output
1 parent d6ccbd6 commit 905c978

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Gruntfile.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ module.exports = function (grunt) {
22
require('time-grunt')(grunt);
33

44
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
githash: {
7+
dist: {
8+
}
9+
},
10+
511
clean: {
612
build: ['build/temp'],
713
dist: ['dist/*']
@@ -17,6 +23,7 @@ module.exports = function (grunt) {
1723

1824
uglify: {
1925
options: {
26+
banner: '/*! v<%= pkg.version %>-<%= githash.dist.short %>, <%= grunt.template.today("isoUtcDateTime") %> */',
2027
sourceMap: true,
2128
sourceMapIncludeSources: true,
2229
sourceMapRoot: './src/',
@@ -242,7 +249,7 @@ module.exports = function (grunt) {
242249
require('load-grunt-tasks')(grunt);
243250
grunt.registerTask('default', ['dist', 'test']);
244251
grunt.registerTask('dist', ['clean', 'jshint', 'jscs', 'browserify:mediaplayer' , 'browserify:protection', 'browserify:reporting', 'browserify:all', 'babel:es5', 'minimize', 'copy:dist']);
245-
grunt.registerTask('minimize', ['exorcise', 'uglify']);
252+
grunt.registerTask('minimize', ['exorcise', 'githash', 'uglify']);
246253
grunt.registerTask('test', ['mocha_istanbul:test']);
247254
grunt.registerTask('watch', ['browserify:watch']);
248255
grunt.registerTask('release', ['default', 'jsdoc']);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"grunt-contrib-uglify": "^0.9.1",
2828
"grunt-contrib-watch": "^0.6.1",
2929
"grunt-exorcise": "^2.1.0",
30+
"grunt-githash": "^0.1.3",
3031
"grunt-githooks": "^0.5.0",
3132
"grunt-jscs": "^2.5.0",
3233
"grunt-jsdoc": "^0.6.0",

0 commit comments

Comments
 (0)