-
Notifications
You must be signed in to change notification settings - Fork 12
/
gruntfile.js
113 lines (100 loc) · 2.79 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
109
110
111
112
113
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//concat all files
concat: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
},
js:{
src: ['public/app.js','public/routes.js','public/controllers/*.js','public/components/*.js','public/services/*.js'],
dest: 'public/js/<%= pkg.name %>.js',
},
css: {
src: ['public/css/*.css', '!public/css/<%= pkg.name %>.css'],
dest: 'public/css/<%= pkg.name %>.css',
},
},
//watch some of these files
watch:{
js:{
files:['gruntfile.js','public/controllers/*.js','public/services/*.js','public/components/*.js'],
tasks:['concat:js','mochaTest'],
options:{
livereload:true
},
},
css:{
files:['public/css/styles.css'],
tasks:['concat:css'],
options:{
livereload:true,
},
},
server:{
files:['server/*/*.js'],
tasks:['jshint','mochaTest'],
options:{
interrupt:true,
livereload:true,
},
},
tests:{
files:['./test/*.js','./karma/*.js','./test/*.html'],
tasks:['jshint','mochaTest']
},
},
//check these files for valid javascripts
jshint:{
options:{
esnext:true,
},
beforeconcat: ['public/*/*.js'],
afterconcat:['public/js/<%= pkg.name %>.js','./test/*.js','./server/*/*.js','!./*/*.mock.js'],
},
//concurrent stuffs
concurrent:{
dev:{
tasks:['nodemon','watch','concat','open'],
},
options: {
logConcurrentOutput: true,
},
},
//load that server bruh
nodemon:{
dev:{
script:'./server/server.js'
},
},
open: {
dev: {
url: 'http://localhost:3000'
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
quiet: false, // Optionally suppress output to standard out (defaults to false)
clearRequireCache: false, // Optionally clear the require cache before running tests (defaults to false)
noFail: false // Optionally set to not fail on failed tests (will still fail on other errors)
},
src: ['test/*.js'],
}
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-open');
// Default task(s).
grunt.registerTask('default', ['concurrent']);
};