-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
59 lines (50 loc) · 1.26 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
module.exports = function( grunt ) {
'use strict';
var pkg = grunt.file.readJSON('package.json'),
dirs = {
src: 'src/',
test: 'test/'
},
forEach = grunt.util._.forEach;
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
grunt.initConfig({
pkg: pkg,
dirs: dirs,
copy: {
options: {
processContent: grunt.template.process
},
prod: {
files: {
'<%= pkg.name %>.js': dirs.src + pkg.name + '.js'
}
}
},
// JavaScript minification
uglify: {
options: {
banner: '/*! <%= pkg.title %> v<%= pkg.version %> */'
},
prod: {
files: {
'<%= pkg.name %>.min.js': pkg.name + '.js'
}
}
},
// Tests
nodeunit : {
dev: [dirs.test + '**/*.js']
}
});
// Load tasks and helpers from the "tasks" directory, relative to gruntfile.js.
// grunt.loadTasks('tasks');
// Load tasks and helpers from the Npm-installed grunt plugins.
var deps = Object.keys(pkg.devDependencies);
forEach(deps, function(dep) {
if (-1 !== dep.search(/^grunt-/)) {
grunt.loadNpmTasks(dep);
}
});
// Default task.
grunt.registerTask('default', ['nodeunit', 'copy', 'uglify']);
};