This repository has been archived by the owner on Apr 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Gruntfile.js
108 lines (91 loc) · 1.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
102
103
104
105
106
107
108
/**
* General Grunt setup
*/
'use strict';
var deepExtend = require('deep-extend');
var loadGruntConfig = require('./grunt/load-grunt-config');
/*
* Call Grunt configuration
*/
module.exports = function (grunt) {
// Measure time of grunt tasks
require('time-grunt')(grunt);
/**
* Configuration: All data from package.json, grunt/options and
* grunt/plugins
*/
var config = deepExtend({
pkg: require('./package')
},
loadGruntConfig('grunt/options'),
loadGruntConfig('grunt/plugins')
);
// Load project configuration
grunt.initConfig(config);
// Load all npm tasks through jit-grunt (all tasks from node_modules)
require('jit-grunt')(grunt);
// Load your own tasks
grunt.task.loadTasks('./grunt/tasks');
/**
* A task to generate pages
*/
// Tasks for generating static pages
grunt.registerTask('pages:dev', [
'concat',
'replace:dev',
'clean:temp'
]);
grunt.registerTask('pages:build', [
'concat',
'replace:build',
'clean:temp'
]);
/**
* A task for development
*/
grunt.registerTask('serve', ['connect:serve', 'watch']);
grunt.registerTask('dev', [
'jshint',
'jscs',
'pleeease:dev',
'copy',
'replace:htaccess',
'browserify:dev',
'pages:dev'
]);
// Default task
grunt.registerTask('default', ['dev']);
/**
* A task for building your pages
*/
grunt.registerTask('build', [
'jshint',
'jscs',
'modernizr:build',
'pleeease:build',
'imagemin',
'copy',
'replace:htaccess',
'browserify:build',
'karma:unit',
'pages:build'
]);
/**
* Testing
*/
// A task for testing development code
grunt.registerTask('test', [
'browserify:test',
'karma:unit'
]);
grunt.registerTask('test:all', [
'karma:all'
]);
/**
* Travis CI task
*/
grunt.registerTask('travis', [
'jshint',
'karma:travis'
]);
};