-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
127 lines (120 loc) · 3.57 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files : {
src:['Gruntfile.js','app.js', 'database/*.js','models/*.js', 'public/**/*.js','!public/lib/**/*.js','routes/**/*.js','routes/*.js','test/*.js','!**/node_modules/**/*.js']//'**/*.js',,'!node_modules/**/*.js'
}
},
htmlhint: {
all: ['**/*.html', '!**/node_modules/**/*.html']
},
csslint: {
all: ['public/stylesheets/**/*.css']
},
// min: {
// jsMinify: {
// files: [{
// expand: true,
// src: ['**/*.js', '!node_modules/**/*.js'],
// dest: '.',
// ext: '.min.js'
// }]
// }
// },
cssmin: {
cssMinify: {
files: [{
expand: true,
src: ['public/stylesheets/**/*.css'],
dest: '.',
ext: '.min.css'
}]
}
},
mochaTest: {
all: {
src: ['test/*.js','!**/node_modules/**/*.js']
}
},
copy: {
main: {
files: [
// includes files within path
{
src: ['**/*', '!node_modules/**', '!test/*.js'],
dest: 'build/'
}
],
},
},
clean: ['build/'],
express: {
server: {
options: {
// Override defaults here
script: 'bin/www',
//livereload: true
// livereload: 1337
}
}
},
// watch: {
// server: {
// files: ['*.js', 'database/*.js','models/*.js', 'public/**/*.js','routes/**/*.js','routes/*.js','test/*.js'],
// tasks: ['jshint','express'],
// options: {
// spawn: false,
// //livereload: true
// // livereload: 1337
// },
// },
// client: {
// files: ['**/*.html', '!node_modules/**/*.html', 'public/stylesheets/**/*.css','public/stylesheets/*.css'],
// tasks: [ 'htmlhint', 'csslint'],
// options: {
// spawn: false,
// livereload: true
// // livereload: 1337
// },
// },
// },
// });
watch: {
server: {
files: ['Gruntfile.js','app.js', 'database/*.js','models/*.js', 'public/**/*.js','!public/lib/**/*.js','routes/**/*.js','routes/*.js','test/*.js','!**/node_modules/**/*.js','**/*.html', '!node_modules/**/*.html', 'public/stylesheets/**/*.css'],
tasks: ['express'],
options: {
spawn: false,
//livereload: true
// livereload: 1337
},
},
// client: {
// files: ['**/*.html', '!node_modules/**/*.html', 'public/stylesheets/**/*.css','public/stylesheets/*.css'],
// tasks: [ 'htmlhint', 'csslint'],
// options: {
// spawn: false,
// livereload: true
// // livereload: 1337
// },
// },
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-htmlhint');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-min');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-express-server');
grunt.registerTask('build', ['clean', 'jshint','htmlhint','csslint','mochaTest', 'copy']);
grunt.registerTask('express-keepalive', function() {
this.async();
});
grunt.registerTask('serve', ['express', 'express-keepalive']);
grunt.loadNpmTasks('grunt-contrib-watch');
//grunt.registerTask('servewatch', ['jshint','htmlhint','csslint','express', 'watch']);
grunt.registerTask('testwatch', ['express', 'watch']);
};