Skip to content
This repository was archived by the owner on Sep 20, 2020. It is now read-only.

Commit e3246c5

Browse files
fix(build): Add versioned header to release files. closes #33
1 parent e411678 commit e3246c5

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

Gruntfile.js

+21-6
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,23 @@ module.exports = function (grunt) {
3434
@toc 5.
3535
*/
3636
grunt.initConfig({
37+
pkg: grunt.file.readJSON('package.json'),
38+
meta: {
39+
banner: '/**\n' +
40+
' * <%= pkg.description %>\n' +
41+
' * @version v<%= pkg.version %><%= buildtag %>\n' +
42+
' * @link <%= pkg.homepage %>\n' +
43+
' * @license MIT License, http://www.opensource.org/licenses/MIT\n' +
44+
' */'
45+
},
3746
concat: {
38-
options: {},
47+
options: {
48+
banner: '<%= meta.banner %>\n\n' +
49+
'(function (window, angular, undefined) {\n',
50+
footer: '})(window, window.angular);'
51+
},
3952
dist: {
40-
src: ['src/_intro.js.txt'].concat(files.src).concat(['src/_outtro.js.txt']),
53+
src: files.src,
4154
dest: 'build/ct-ui-router-extras.js'
4255
}
4356
},
@@ -83,12 +96,14 @@ module.exports = function (grunt) {
8396
},
8497
uglify: {
8598
options: {
86-
mangle: false
99+
mangle: false,
100+
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
101+
'<%= grunt.template.today("yyyy-mm-dd") %> */'
87102
},
88103
build: {
89-
files: {},
90-
src: 'build/ct-ui-router-extras.js',
91-
dest: 'build/ct-ui-router-extras.min.js'
104+
files: {
105+
'build/ct-ui-router-extras.min.js': [ 'build/ct-ui-router-extras.js' ]
106+
}
92107
}
93108
},
94109
karma: {

0 commit comments

Comments
 (0)