-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
98 lines (81 loc) · 1.48 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
/*jshint node:true*/
'use strict';
var CONFIG = {
source : 'project/source/',
static : 'project/static/',
templates : 'project/templates/'
};
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt, {
sprite: 'grunt-spritesmith'
})({
loadTasks: 'grunt/tasks'
});
[
'autoprefixer',
'clean',
'copy',
'django',
'emberTemplates',
'jshint',
'neuter',
'modernizr',
'notify',
'sass',
'sprite',
'uglify',
'watch',
'webfont'
].forEach(function (key) {
grunt.config(key, require('./grunt/config/' + key)(CONFIG));
});
grunt.registerTask('server', function (port) {
if (port) {
grunt.config('django.port', port);
}
grunt.task.run([
// Run tasks once before starting watchers
'develop',
// Start server
'django',
// Watch files for changes
'watch'
]);
});
// Build unminified files during development
grunt.registerTask('develop', [
'clean',
// JS
'neuter:libsDevelop',
'neuter:app',
'neuter:tests',
'emberTemplates',
// CSS
'sass:develop',
'autoprefixer:develop',
'fixSourceMaps',
// OTHER FILES
'copy'
]);
// Build minified files for deployment
grunt.registerTask('build', [
'clean',
// JS
'jshint',
'neuter:libsBuild',
'neuter:app',
'modernizr',
'emberTemplates',
'uglify',
// CSS
'sass:build',
'autoprefixer:build',
// TEMP FOLDER
'clean:temp',
// OTHER FILES
'copy',
'notify:build'
]);
grunt.registerTask('default', ['build']);
};