-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGruntfile.js
46 lines (38 loc) · 1.21 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';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
// Load tasks and configuration.
grunt.loadTasks('build');
// Register alias tasks.
grunt.registerTask('setup-dev',
'Prepare development environment',
['test-unit', 'clean:prod', 'jade:dev', 'stylus:dev', 'server:dev']);
grunt.registerTask('lint',
'Statically analyze the project JavaScript for errors and code style',
['jscs', 'jshint']);
grunt.registerTask('test-unit',
'Run the unit tests in a headless browser',
['lint', 'mocha']);
grunt.registerTask('test-integration',
'Run integration tests in a real browser',
['setup-dev', 'spawn:mochaTest']);
grunt.registerTask('prod',
'Compile for production.',
[
'test-unit', 'clean:prod', 'jade:prod', 'stylus:prod', 'requirejs',
'copy:prod', 'server:prod'
]);
grunt.registerTask('dev',
'Start a development web server.',
['setup-dev', 'watch']);
grunt.registerTask('server',
'Start the REST and connect servers.',
function() {
require('./server/server');
grunt.task.run('connect:' + this.args.join(':'));
}
);
grunt.registerTask('default', ['dev']);
};