-
Notifications
You must be signed in to change notification settings - Fork 2
/
grunt.js
99 lines (92 loc) · 2.22 KB
/
grunt.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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
lint: {
files: ['grunt.js', 'mvc/**/*.js', 'test/*_test.js']
},
concat: {
// Public JS
'public': {
src: [
// sugar
'public/sugar.js',
// jQuery, then Bootstrap
'public/js/jquery.js', 'public/js/bootstrap.js',
// then Knockout
'public/js/knockout.js',
// then GMaps
'public/js/gmaps.js',
// then other js libs
'public/js/*.js'
],
dest: 'dist/js/all.js'
},
'models': {
src: [
'models/api.js', 'models/contribution.js',
// Mapper list before all
'models/mapperList.js',
// Location then geospecify
'models/location.js', 'models/geospecify.js',
'models/*.js'
],
dest: 'dist/models/all.js'
},
'views': {
src: ['views/*.html'],
dest: 'dist/views/all.html'
}
},
less: {
'public': {
src: 'public/css/index.less',
dest: 'dist/css/all.css'
}
},
watch: {
'js': {
files: ['public/js/**', 'mvc/**/*.js', 'models/**/*.js','views/**/*.html'],
tasks: 'js'
},
'css': {
files: 'public/css/**',
tasks: 'css'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
// ugh, should get a proper set up for envs
browser: true,
// Ignore strict
strict: false
},
globals: {
exports: true,
describe: true,
it: true,
ko: true,
$: true,
getCoordinates: true
}
}
});
// Load in grunt-contrib (contains LESS)
grunt.loadNpmTasks('grunt-contrib');
// Default task.
// grunt.registerTask('default', 'lint concat less test');
grunt.registerTask('default', 'single watch');
grunt.registerTask('single', 'js css');
grunt.registerTask('js', 'lint concat');
grunt.registerTask('css', 'less');
};