Skip to content

Commit fe3cf0a

Browse files
committed
Add usebanner task and banner template
refer to the values of properties within package.json file (project name, current version, etc..)
1 parent 2a9f3ca commit fe3cf0a

4 files changed

Lines changed: 53 additions & 26 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: 8 additions & 12 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;
@@ -25,18 +25,14 @@ Copyright (c) 2015 Daniel Eden
2525
animation-duration: 2s;
2626
}
2727

28+
.animated.flipOutX,
29+
.animated.flipOutY,
2830
.animated.bounceIn,
2931
.animated.bounceOut {
3032
-webkit-animation-duration: .75s;
3133
animation-duration: .75s;
3234
}
3335

34-
.animated.flipOutX,
35-
.animated.flipOutY {
36-
-webkit-animation-duration: .75s;
37-
animation-duration: .75s;
38-
}
39-
4036
@-webkit-keyframes bounce {
4137
from, 20%, 53%, 80%, to {
4238
-webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);

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.

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)