-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGruntfile.js
More file actions
86 lines (76 loc) · 2.36 KB
/
Gruntfile.js
File metadata and controls
86 lines (76 loc) · 2.36 KB
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
'use strict';
var path = require('path');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
express: {
livereload: {
options: {
port: 9000,
bases: path.resolve('public'),
monitor: {},
debug: true,
server: path.resolve('./app/server')
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['lib/**/*.js']
},
test: {
src: ['test/**/*.js']
},
},
regarde: {
pub: {
files: 'public/**/*',
tasks: ['livereload']
},
trigger: {
files: '.server',
tasks: 'express-restart:livereload'
},
express: {
files: 'app/templates/hello.dust',
tasks: 'livereload'
}
},
jsbeautifier: {
files: ['Gruntfile.js'],
options: {
'indent_size': 4,
'indent_char': ' ',
'indent_level': 0,
'indent_with_tabs': false,
'preserve_newlines': true,
'max_preserve_newlines': 10,
'jslint_happy': false,
'brace_style': 'collapse',
'keep_array_indentation': false,
'keep_function_indentation': false,
'space_before_conditional': true,
'eval_code': false,
'indent_case': false,
'unescape_strings': false
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-regarde');
grunt.registerTask('format', ['jshint', 'jsbeautifier']);
grunt.registerTask('server', ['livereload-start', 'express', 'regarde']);
// Default task.
grunt.registerTask('default', ['format', 'server']);
};