-
Notifications
You must be signed in to change notification settings - Fork 42
/
Gruntfile.js
104 lines (84 loc) · 1.78 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
/*jshint node:true*/
'use strict';
var CONFIG = {
pages: 'pages/',
source: 'static/',
static: './build/static/',
deploy: './build/'
};
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt)({
loadTasks : 'grunt/tasks'
});
[
'autoprefixer',
'clean',
'connect',
'copy',
'handlebars',
'haychtml',
'jshint',
'neuter',
'notify',
'sass',
'uglify',
'watch'
].forEach(function (key) {
grunt.config(key, require('./grunt/config/' + key)(CONFIG));
});
grunt.registerTask('server', function (port) {
var livereloadPort = Math.round(port) + 30000;
if (port) {
grunt.config('watch.livereload.options.livereload', livereloadPort);
grunt.config('connect.options.livereload', livereloadPort);
grunt.config('connect.options.port', port);
}
grunt.task.run([
// Run tasks once before starting watchers
'develop',
// Start server
'connect',
// Watch files for changes
'watch'
]);
});
// Build unminified files during development
grunt.registerTask('develop', [
'clean',
// JS
'handlebars',
'neuter',
'shaderChunks',
// CSS
'sass:develop',
'autoprefixer:develop',
// HTML
'haychtml:develop',
// OTHER FILES
'copy:develop',
'copy:build'
]);
// Build minified files for deployment
grunt.registerTask('build', [
'clean',
// JS
'jshint',
'handlebars',
'neuter',
'shaderChunks',
'uglify',
// CSS
'sass:build',
'autoprefixer:build',
// HTML
'haychtml:build',
// OTHER FILES
'copy:build',
// TEMP FOLDER
'clean:temp',
// NOTIFICATION
'notify:build'
]);
grunt.registerTask('default', ['build']);
};