-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathGruntfile.js
119 lines (116 loc) · 4.22 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
117
118
119
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
flake8: {
options: {
ignore: ['E501']
},
evething: {
src: [
'*.py',
'core/*.py',
'evething/*.py',
'!evething/local_settings*.py'
]
},
thing: {
src: [
'thing/*.py',
'thing/tests/*.py',
'thing/templatetags/*.py'
]
},
thing_tasks: {
src: 'thing/tasks/*.py'
},
thing_models: {
src: 'thing/models/*.py'
},
thing_views: {
src: 'thing/views/*.py'
}
},
handlebars: {
handlebars: {
options: {
namespace: 'Handlebars.templates',
processName: function (filePath) {
return filePath.replace(/^static\/handlebars\//, '').replace(/\.handlebars$/, '');
}
},
files: {
'static/js/templates.js': 'static/handlebars/*.handlebars'
}
}
},
concat: {
bootstrap: {
src: [
'static/js/bootstrap/alert.js',
'static/js/bootstrap/button.js',
'static/js/bootstrap/collapse.js',
'static/js/bootstrap/dropdown.js',
'static/js/bootstrap/modal.js',
'static/js/bootstrap/tooltip.js',
'static/js/bootstrap/popover.js',
'static/js/bootstrap/tab.js',
'static/js/bootstrap/scrollspy.js',
'static/js/bootstrap/affix.js',
'static/js/bootstrap-datepicker.js'
],
dest: 'static/js/bootstrap.js'
}
},
uglify: {
combined: {
options: {
sourceMap: true
},
src: [
'static/js/jquery.tablesorter.js',
'static/js/jquery.tablesorter.widgets.js',
'static/js/bootstrap.js',
'static/js/handlebars.runtime.js',
'static/js/templates.js',
'static/js/evething.js',
'static/js/evething/*.js'
],
dest: 'static/js/evething-combined.min.js'
}
},
less: {
options: {
modifyVars: {
'icon-font-path': '"../fonts/"',
'fa-font-path': '"../fonts"'
},
sourceMap: true,
plugins: [
new (require('less-plugin-clean-css'))({
'advanced': true,
'sourceMap': true
})
]
},
themes: {
files: {
'static/css/theme-cerulean.min.css': 'static/less/theme-cerulean/bootstrap.less',
'static/css/theme-yeti.min.css': 'static/less/theme-yeti/bootstrap.less',
'static/css/theme-cosmo.min.css': 'static/less/theme-cosmo/bootstrap.less',
'static/css/theme-cyborg.min.css': 'static/less/theme-cyborg/bootstrap.less',
'static/css/theme-darkthing.min.css': 'static/less/theme-darkthing/bootstrap.less',
'static/css/theme-default.min.css': 'static/less/theme-default/bootstrap.less',
'static/css/theme-slate.min.css': 'static/less/theme-slate/bootstrap.less'
}
}
}
});
grunt.loadNpmTasks('grunt-flake8');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task(s).
grunt.registerTask('default', ['handlebars', 'concat', 'uglify', 'less']);
};