-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
90 lines (79 loc) · 1.89 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
var config;
var matchdep = require('matchdep');
var module;
config = {
files: {
build: 'lib/marionette.googleAnalyticsEvents.js',
check: [
'lib/marionette.googleAnalyticsEvents.js',
'Gruntfie.js'
],
dest: 'dist/marionette.googleAnalyticsEvents.min.js',
docs: 'docs'
}
};
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var defaultTasks;
grunt.initConfig({
pkg: pkg,
jshint: {
options: {
jshintrc: true
},
all: {
files: {
src: config.files.check
}
}
},
jscs: {
all: {
files: {
src: config.files.check
}
}
},
groc: {
options: {
out: config.files.docs,
strip: 'lib/'
},
all: {
src: config.files.build
},
github: {
options: {
github: true
},
src: config.files.build
}
},
uglify: {
all: {
src: config.files.build,
dest: config.files.dest
}
},
watch: {
options: {
interrupt: true
},
js: {
files: config.files.check,
tasks: ['uglify', 'groc:all']
}
}
});
// Load all npm dependencies.
matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Register tasks.
defaultTasks = [
'jshint',
'jscs',
'groc:all',
'uglify'
];
grunt.registerTask('default', defaultTasks);
grunt.registerTask('dev', defaultTasks.concat('watch'));
};