-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
107 lines (101 loc) · 3.62 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
'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-bower');
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
prod: {
dest: 'html/vendor',
images_dest: 'html/vendor/img',
js_dest: 'html/vendor/js',
css_dest: 'html/vendor/css',
fonts_dest: 'html/vendor/fonts',
options: {
expand: false,
keepExpandedHierarchy: false,
packageSpecific: {
bootstrap: {
files: [
"dist/css/bootstrap.min.css",
"dist/js/bootstrap.min.js"
]
},
jquery: {
files: [
"dist/jquery.min.js"
]
},
"html5-boilerplate": {
files: [
"404.html",
"apple-touch-icon.png",
"crossdomain.xml",
"browserconfig.xml",
"favicon.ico",
"robots.txt"
]
},
fontawesome: {
files: [
"css/font-awesome.min.css",
"fonts/FontAwesome.otf",
"fonts/fontawesome-webfont.svg",
"fonts/fontawesome-webfont.woff",
"fonts/fontawesome-webfont.eot",
"fonts/fontawesome-webfont.ttf",
"fonts/fontawesome-webfont.woff2"
]
}
}
},
}
},
eslint: {
target: ['server.js', 'lib/*.js', 'test/*.js'],
},
mochaTest: {
options: {
},
any: {
src: ['test/*.js']
}
},
nodemon: {
dev: {
script: 'server.js',
options: {
env: {
NODE_ENV: 'test'
},
callback: function(nodemon) {
nodemon.on('log', function(event) {
console.log(event.colour);
});
// opens browser on initial server start
nodemon.on('config:update', function() {
// Delay before server listens on port
setTimeout(function() {
require('open')('http://localhost:8000/');
}, 1000);
});
}
}
}
},
watch: {
files: ['<%= eslint.target %>'],
tasks: ['eslint', 'mochaTest']
},
clean: {
build: ['build', 'html/js/client.js'],
},
});
// Default task(s).
grunt.registerTask('default', ['eslint', 'mochaTest']);
};