-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.js
83 lines (78 loc) · 2 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
endpoint: "."
},
stylus: {
compile: {
options: {compress: false},
files: {
'_src/css/bbtoolkit.css': '_src/stylus/bbtoolkit.styl'
}
}
},
jade: {
compile: {
options: {
pretty: true,
data: grunt.file.readJSON('_src/bbtoolkit.json')
},
files: [
{expand: true, cwd: '_src/jade', src: ['**/*.jade', '!_*'], dest: '<%=meta.endpoint%>/', ext: '.html'}
]
}
},
concat: {
js: {
options: {
separator: ';'
},
src: ['_src/js/respond.js', '_src/js/bootstrap.min.js', '_src/js/fastclick.min.js', '_src/js/bbtoolkit.js'],
dest: '<%=meta.endpoint%>/js/bbtoolkit-combined.js',
nonull: true
},
css: {
src: ['_src/css/bootstrap.min.css', '_src/css/bbtoolkit.css'],
dest: '<%=meta.endpoint%>/css/bbtoolkit-combined.css',
nonull: true
}
},
uglify: {
dist: {
files: {
'<%=meta.endpoint%>/js/bbtoolkit-combined.min.js': ['<%= concat.js.dest %>']
}
}
},
watch: {
html: {
files: ['**/*.jade','_src/bbtoolkit.json'],
tasks: ['jade'],
options: {
interrupt: true
}
},
css: {
files: ['_src/stylus/*.styl'],
tasks: ['stylus:compile', 'concat:css'],
options: {
interrupt: true
}
},
js: {
files: ['_src/js/*.js'],
tasks: ['concat:js', 'uglify'],
options: {
interrupt: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jade', 'stylus', 'concat', 'uglify']);
};