Skip to content

Commit ea4ac9b

Browse files
committed
Merge pull request #487 from woneob/usebanner
Automatically generate the banner
2 parents 11188f5 + a6bb172 commit ea4ac9b

5 files changed

Lines changed: 56 additions & 20 deletions

File tree

Gruntfile.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,40 @@ module.exports = function(grunt) {
3131
}
3232
},
3333

34+
banner: [
35+
'/*!',
36+
' * <%= _.capitalize(pkg.name) %> -<%= pkg.homepage %>',
37+
' * Version - <%= pkg.version %>',
38+
' * Licensed under the MIT license - http://opensource.org/licenses/MIT',
39+
' *',
40+
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>',
41+
' */',
42+
].join('\n'),
43+
44+
usebanner: {
45+
options: {
46+
position: 'replace',
47+
linebreak: false,
48+
replace: /\/\*!(\s+)?inject-banner(\s+)?\*\//
49+
},
50+
development: {
51+
options: {
52+
banner: '<%= banner %>'
53+
},
54+
files: {
55+
src: [ 'animate.css']
56+
}
57+
},
58+
production: {
59+
options: {
60+
banner: '\n<%= banner %>\n'
61+
},
62+
files: {
63+
src: ['animate.min.css']
64+
}
65+
}
66+
},
67+
3468
watch: {
3569
css: {
3670
files: [ 'source/**/*', 'animate-config.json' ],
@@ -73,7 +107,7 @@ module.exports = function(grunt) {
73107

74108
// register task
75109
grunt.registerTask('concat-anim', 'Concatenates activated animations', concatAnim); // custom task
76-
grunt.registerTask('default', ['concat-anim', 'autoprefixer', 'cssmin']);
110+
grunt.registerTask('default', ['concat-anim', 'autoprefixer', 'cssmin', 'usebanner']);
77111
grunt.registerTask('dev', ['watch']);
78112

79113
};

animate.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@charset "UTF-8";
22

33
/*!
4-
Animate.css - http://daneden.me/animate
5-
Version - 3.4.0
6-
Licensed under the MIT license - http://opensource.org/licenses/MIT
7-
8-
Copyright (c) 2015 Daniel Eden
9-
*/
4+
* Animate.css -http://daneden.me/animate
5+
* Version - 3.4.0
6+
* Licensed under the MIT license - http://opensource.org/licenses/MIT
7+
*
8+
* Copyright (c) 2015 Daniel Eden
9+
*/
1010

1111
.animated {
1212
-webkit-animation-duration: 1s;

animate.min.css

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"type": "git",
77
"url": "https://github.com/daneden/animate.css.git"
88
},
9+
"author": {
10+
"name": "Daniel Eden"
11+
},
12+
"homepage": "http://daneden.me/animate",
913
"license": "MIT",
1014
"jspm": {
1115
"main": "animate.css!",
@@ -18,6 +22,7 @@
1822
"grunt": "~0.4.1",
1923
"grunt-autoprefixer": "~0.4.0",
2024
"grunt-contrib-watch": "~0.5.3",
25+
"grunt-banner": "~0.6.0",
2126
"grunt-contrib-concat": "~0.3.0",
2227
"grunt-contrib-cssmin": "~0.8.0",
2328
"load-grunt-tasks": "~0.2.0"

source/_base.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
@charset "UTF-8";
2-
/*!
3-
Animate.css - http://daneden.me/animate
4-
Version - 3.4.0
5-
Licensed under the MIT license - http://opensource.org/licenses/MIT
62

7-
Copyright (c) 2015 Daniel Eden
8-
*/
3+
/*! inject-banner */
94

105
.animated {
116
animation-duration: 1s;

0 commit comments

Comments
 (0)