forked from fooplugins/FooTable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
103 lines (97 loc) · 3.12 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
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('footable.jquery.json'),
clean: {
files: ['dist']
},
csslint: {
strict: {
options: {
csslintrc: '.csslintrc'
},
src: ['css/*.css']
}
},
uglify: {
all : {
options: {
preserveComments: 'some',
mangle: {
except: [ "undefined" ]
}
},
files: {
'dist/footable.min.js': [ 'js/footable.js' ],
'dist/footable.filter.min.js': [ 'js/footable.js' ],
'dist/footable.paginate.min.js': [ 'js/footable.paginate.js' ],
'dist/footable.sort.min.js': [ 'js/footable.sort.js' ]
}
}
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'js/.jshintrc'
},
src: ['js/**/*.js']
}
},
less: {
development: {
files: {
"css/footable.core.css": "less/footable.core.less",
"css/footable.metro.css": "less/footable.metro.less",
"css/footable.standalone.css": "less/footable.standalone.less",
"css/footable.css": "less/*.less"
}
},
production: {
options: {
yuicompress: true
},
files: {
"css/footable.core.min.css": "less/footable.core.less",
"css/footable.metro.min.css": "less/footable.metro.less",
"css/footable.standalone.min.css": "less/footable.standalone.less",
"css/footable.min.css": "less/*.less"
}
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src']
},
less: {
files: 'less/*.less',
tasks: ['less:development']
},
csslint: {
files: 'css/*.css',
tasks: ['csslint']
}
}
});
// Load grunt tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-csslint');
// Default task.
grunt.registerTask('default', ['jshint', 'clean', 'uglify', 'less', 'csslint']);
// Test task
grunt.registerTask('test', ['jshint']);
};