-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
66 lines (62 loc) · 1.39 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
function lastModified(minutes) {
return function(filepath) {
var filemod = (require('fs').statSync(filepath)).mtime;
var timeago = (new Date()).setDate((new Date()).getMinutes() - minutes);
return (filemod > timeago);
}
}
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
force: true,
laxbreak: true,
laxcomma: true,
// reporterOutput: true, // not working
globals: {
jQuery: true
}
},
all: {
src: ['js/*.js'],
filter: lastModified(24 * 60) // one day ago
},
},
less: {
development: {
options: {
paths: ["js/lib/bootstrap/less/"],
yuicompress: false
},
files: {
"css/bootstrap.css": "js/lib/bootstrap/less/bootstrap.less"
}
}
},
cssmin: {
minify: {
expand: true,
cwd: 'dist/',
src: ['*.css', '!*.min.css'],
dest: 'dist/',
ext: '.min.css'
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: ['css/*.css', 'js/lib/animo.js/animate+animo.css'],
dest: 'dist/concat.css'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['jshint']);
grunt.registerTask('css', ['less', 'concat', 'cssmin']);
};