This repository was archived by the owner on Mar 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgrunt.js
83 lines (77 loc) · 1.86 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
/*global module:false*/
module.exports = function(grunt) {
var SRC_CSS = 'src/css/';
var SRC_JS = 'src/js/';
var BUILD_CSS = 'css/';
var BUILD_JS = 'js/';
grunt.initConfig({
lint: {
files: [SRC_JS + 'app/**/*.js']
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {'Backbone': true,
'Handlebars': true,
'_': true,
'$': true,
'SL': true}
},
less: {
css: {
src: [SRC_CSS + 'less/base.less'],
dest: SRC_CSS + 'app/base.css',
}
},
concat: {
css: {
src: [SRC_CSS + 'libs/*.css',
SRC_CSS + 'app/*.css'],
dest: BUILD_CSS + 'css/all.css'
},
js: {
src: [SRC_JS + 'libs/zepto.js',
SRC_JS + 'libs/zepto-mods.js',
SRC_JS + 'libs/zepto-data.js',
SRC_JS + 'libs/bootstrap.js',
SRC_JS + 'libs/underscore.js',
SRC_JS + 'libs/backbone.js',
SRC_JS + 'libs/handlebars.js',
SRC_JS + 'libs/timeago.js',
SRC_JS + 'app/models.js'],
dest: BUILD_JS + 'js/all.js'
},
},
jsmin: {
js: {
src: '<config:concat.js.dest>',
dest: BUILD_JS + 'js/all-min.js'
}
},
cssmin: {
css: {
src: '<config:concat.css.dest>',
dest: BUILD_CSS + 'css/all-min.css'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint'
}
});
grunt.loadNpmTasks('grunt-less');
grunt.loadNpmTasks('grunt-css');
// Default task.
grunt.registerTask('default', 'lint less concat jsmin cssmin');
};