-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
46 lines (38 loc) · 1.14 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
'use strict';
/* global module: false, process: false */
module.exports = function (grunt) {
require('time-grunt')(grunt);
var options = {
singleRun: grunt.option('single-run') !== false,
color: grunt.option('color') !== false
};
// Load config and plugins (using jit-grunt)
require('load-grunt-config')(grunt, {
configPath: require('path').join(process.cwd(), 'grunt-configs'),
data: options
});
// Default task
grunt.registerTask('default', function () {
grunt.task.run(['validate', 'test']);
});
/**
* Validate tasks
*/
grunt.registerTask('validate', ['eslint']);
/**
* Test tasks
*/
grunt.registerTask('test', function () {
if (options.singleRun === false) {
grunt.config.set('karma.options.singleRun', false);
grunt.config.set('karma.options.autoWatch', true);
}
grunt.task.run('karma');
});
/**
* Compile tasks
*/
grunt.registerTask('bundle', function () {
grunt.task.run(['clean', 'shell:collections', 'shell:config', 'replace', 'cacheBust']);
});
};