forked from fooplugins/FooTable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
116 lines (108 loc) · 3.65 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
'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.grid.min.js': [ 'js/footable.grid.js' ],
'dist/footable.filter.min.js': [ 'js/footable.filter.js' ],
'dist/footable.paginate.min.js': [ 'js/footable.paginate.js' ],
'dist/footable.sort.min.js': [ 'js/footable.sort.js' ],
'dist/footable.striping.min.js': [ 'js/footable.striping.js' ],
'dist/footable.bookmarkable.min.js': [ 'js/footable.bookmarkable.js' ]
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [ 'dist/footable.min.js', 'dist/footable.grid.min.js', 'dist/footable.filter.min.js', 'dist/footable.paginate.min.js', 'dist/footable.sort.min.js', 'dist/footable.striping.min.js', 'dist/footable.bookmarkable.min.js' ],
dest: 'dist/footable.all.min.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"
}
},
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"
}
}
},
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-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task.
grunt.registerTask('default', ['jshint', 'clean', 'uglify', 'concat', 'less', 'csslint']);
// Test task
grunt.registerTask('test', ['jshint']);
};