forked from nadangergeo/RWD-Table-Patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
145 lines (141 loc) · 4.17 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
filename: 'rwd-table',
banner: '/*!\n' +
' * Responsive Tables v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * <%= pkg.description %>\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Authors: Nadan Gergeo <nadan.gergeo@gmail.com> (www.gergeo.se) & Maggie Wachs (www.filamentgroup.com)\n' +
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' */',
jshint: {
all: ['src/js/*.js']
},
uglify: {
build: {
src: 'src/js/<%= filename %>.js',
dest: 'dist/js/<%= filename %>.min.js'
}
},
less: {
development: {
options: {
compress: false
},
files: {
// target.css file: source.less file
"dist/css/<%= filename %>.css": "src/less/<%= filename %>.less"
}
},
production: {
options: {
compress: true
},
files: {
// target.css file: source.less file
"dist/css/<%= filename %>.min.css": "src/less/<%= filename %>.less",
}
},
docs: {
options: {
compress: true
},
files: {
// target.css file: source.less file
"docs/css/docs.min.css": "docs/css/docs.less"
}
}
},
copy: {
dist: {
src: 'src/js/<%= filename %>.js',
dest: 'dist/js/<%= filename %>.js',
},
docs: {
files: [
{expand: true, flatten: true, src: ['dist/js/*'], dest: 'docs/js/', filter: 'isFile'},
{expand: true, flatten: true, src: ['dist/css/*'], dest: 'docs/css/', filter: 'isFile'}
]
}
},
usebanner: {
dist: {
options: {
position: 'top',
banner: '<%= banner %>',
linebreak: true
},
files: {
src: [ 'dist/css/*.css', 'dist/js/*.js']
}
},
docs: {
options: {
position: 'top',
banner: '<%= banner %>',
linebreak: true
},
files: {
src: [ 'docs/css/docs.css']
}
}
},
watch: {
src: {
// rebuild if files in src changes
files: ['src/**'],
tasks: ['build'],
options: {
livereload: {
animate: true
}
}
},
docs: {
// if docs.less changes compile and add banner
files: ['docs/css/*.less'],
tasks: ['less:docs', 'usebanner:docs'],
options: {
livereload: {
animate: true
}
}
}
},
bump: {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['-a'], // '-a' for all files
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-bump');
grunt.registerTask('build', [
'jshint',
'uglify',
'less',
'copy:dist',
'usebanner',
'copy:docs'
]);
// Default task(s).
grunt.registerTask('default', ['build']);
};