-
Notifications
You must be signed in to change notification settings - Fork 95
/
Gruntfile.js
101 lines (98 loc) · 3.89 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';{}' // hack that 'works' for both JavaScript and CSS.
}
},
copy: {
jade_edx: {expand: true,
flatten: true,
src: ['jade_edx.html', 'jade.css'],
dest: 'build/'
},
jade_workbook: {expand: true,
flatten: true,
src: ['jade_workbook.html', 'jade.css'],
dest: 'build/'
},
jade: {expand: true,
flatten: true,
src: ['jade.html','jade.css','server.py', 'README.standalone'],
dest: 'build/'
},
jade_6004: {expand: true,
flatten: true,
src: ['jade_6004.html', 'jade.css'],
dest: 'build/'
},
jade_local: {expand: true,
flatten: true,
src: ['jade_local.html', 'jade.css'],
dest: 'build/'
},
font_awesome: {expand: true,
flatten: true,
src:['fontawesome-webfont*','FontAwesome.otf'],
dest: 'build/'
}
},
uglify: {
options: {
beautify: {
ascii_only: true, // This prevents us screwing up on servers that don't sent correct content headers.
beautify: false
}
}
},
useminPrepare: {
jade_edx: 'jade_edx.html',
jade_workbook: 'jade_workbook.html',
jade: 'jade.html',
jade_6004: 'jade_6004.html',
jade_local: 'jade_local.html',
options: {
dest: 'build'
}
},
usemin: {
jade_edx: {
src: 'build/jade_edx.html',
options: {type: 'html'}
},
jade_workbook: {
src: 'build/jade_workbook.html',
options: {type: 'html'}
},
jade: {
src: 'build/jade.html',
options: {type: 'html'}
},
jade_6004: {
src: 'build/jade_6004.html',
options: {type: 'html'}
},
jade_local: {
src: 'build/jade_local.html',
options: {type: 'html'}
},
options: {
dirs: ['build']
}
}
});
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('jade_6004', ['copy:jade_6004', 'copy:font_awesome', 'useminPrepare:jade_6004', 'concat', 'uglify', 'usemin:jade_6004']);
grunt.registerTask('jade_edx', ['copy:jade_edx', 'copy:font_awesome', 'useminPrepare:jade_edx', 'concat', 'uglify', 'usemin:jade_edx']);
grunt.registerTask('jade_workbook', ['copy:jade_workbook', 'copy:font_awesome', 'useminPrepare:jade_workbook', 'concat', 'uglify', 'usemin:jade_workbook']);
grunt.registerTask('jade', ['copy:jade', 'copy:font_awesome', 'useminPrepare:jade', 'concat', 'uglify', 'usemin:jade']);
grunt.registerTask('jade_local', ['copy:jade_local', 'copy:font_awesome', 'useminPrepare:jade_local', 'concat', 'usemin:jade_local']);
// Builds everything if just called as 'grunt'
grunt.registerTask('default', ['jade']);
};