-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
84 lines (54 loc) · 1.71 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
/* jshint node: true */
'use strict';
function getTask(name) {
return require('./src/tasks/' + name + '.js');
}
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt, {
pattern: [
'grunt-*',
'assemble*'
]
});
// Project configuration.
grunt.initConfig({
// Project Metadata
pkg: grunt.file.readJSON('package.json'),
config: grunt.file.readYAML('_config.yml'),
banner: '/**\n' +
'* SPC - <%=pkg.name %> v<%= pkg.version %>\n' +
'* Author : <%= pkg.author.name %> \n' +
'* Copyright <%= grunt.template.today("yyyy") %>\n' +
'* Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
'*/\n',
clean: getTask('clean'),
copy: getTask('copy'),
less: getTask('less'),
concat: getTask('concat'),
uglify: getTask('uglify'),
wiredep: getTask('wiredep'),
usebanner: getTask('usebanner'),
/**
* Lint JavaScript
*/
jshint: getTask('jshint'),
/**
* Build HTML from templates and data
*/
assemble: getTask('assemble'),
htmlmin: getTask('htmlmin'),
modernizr: getTask('modernizr'),
watch: getTask('watch'),
connect: getTask('connect')
});
// JS distribution task.
grunt.registerTask('dist-js', ['modernizr', 'jshint', 'concat', 'uglify']);
// Full distribution task.
grunt.registerTask('dist', ['clean', 'copy', 'less', 'dist-js', 'usebanner']);
//grunt.registerTask('dist', ['clean', 'copy', 'dist-js', 'usebanner']);
grunt.registerTask('serve', ['connect:livereload', 'watch']);
// Default task.
//grunt.registerTask('default', ['test', 'dist']);
grunt.registerTask('default', ['dist', 'assemble']);
};