Skip to content

Commit

Permalink
Fix #1521 - add banner with version, git sha1, build time and date to…
Browse files Browse the repository at this point in the history
… all minified output
  • Loading branch information
davemevans committed Oct 4, 2016
1 parent d6ccbd6 commit 905c978
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Gruntfile.js
Expand Up @@ -2,6 +2,12 @@ module.exports = function (grunt) {
require('time-grunt')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
githash: {
dist: {
}
},

clean: {
build: ['build/temp'],
dist: ['dist/*']
Expand All @@ -17,6 +23,7 @@ module.exports = function (grunt) {

uglify: {
options: {
banner: '/*! v<%= pkg.version %>-<%= githash.dist.short %>, <%= grunt.template.today("isoUtcDateTime") %> */',
sourceMap: true,
sourceMapIncludeSources: true,
sourceMapRoot: './src/',
Expand Down Expand Up @@ -242,7 +249,7 @@ module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['dist', 'test']);
grunt.registerTask('dist', ['clean', 'jshint', 'jscs', 'browserify:mediaplayer' , 'browserify:protection', 'browserify:reporting', 'browserify:all', 'babel:es5', 'minimize', 'copy:dist']);
grunt.registerTask('minimize', ['exorcise', 'uglify']);
grunt.registerTask('minimize', ['exorcise', 'githash', 'uglify']);
grunt.registerTask('test', ['mocha_istanbul:test']);
grunt.registerTask('watch', ['browserify:watch']);
grunt.registerTask('release', ['default', 'jsdoc']);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -27,6 +27,7 @@
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-exorcise": "^2.1.0",
"grunt-githash": "^0.1.3",
"grunt-githooks": "^0.5.0",
"grunt-jscs": "^2.5.0",
"grunt-jsdoc": "^0.6.0",
Expand Down

0 comments on commit 905c978

Please sign in to comment.