-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
103 lines (95 loc) · 2.61 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
'use strict';
/*
SECRET COW LEVEL - HTML5 Gruntfile Configuration
Author: [email protected]
Date: 11.08.2013
*/
module.exports = function (grunt) {
grunt.initConfig(
{
// Give Grunt access to the package.json file info
pkg: grunt.file.readJSON('package.json'),
// this will uglify/minify/concat our files
uglify:
{
options:
{
mangle: true,
compress: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
js:
{
files:
{
'static/js/scl.min.js': ['lib/client/js/*'],
'static/js/vendor.min.js': ['lib/client/vendor/*']
}
}
},
// We use this to make sure our JS files follow our spec
jshint:
{
server:
{
src: ['./*.js', 'lib/*.js'],
options:
{
'jshintrc': true,
'ignores': 'newrelic.js'
}
},
client:
{
src: ['lib/client/js/*'],
options:
{
'jshintrc': true,
'ignores': 'newrelic.js'
}
}
},
// Watch for changes to trigger events
watch:
{
client:
{
files: ['lib/client/**/*.js', 'lib/*.js', './*.js' ],
tasks: [ 'jshint', 'uglify']
},
},
// restart node server, if necessary
nodemon:
{
dev:
{
options:
{
file: 'app.js',
}
}
},
// This allows us to concurrently watch JS for tasks and nodemon to restart
concurrent:
{
dev:
{
tasks: ['nodemon', 'watch'],
options:
{
logConcurrentOutput: true
}
}
}
});
// Load the plugins we want to use
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-notify');
// Register the tasks to run
grunt.registerTask('default', [ 'jshint', 'uglify', 'concurrent' ]);
};