-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
58 lines (46 loc) · 961 Bytes
/
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
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
src: [
'src/index.js',
'src/util.js',
'src/format.js',
'src/format/parseXModule.js',
'src/format/parsePTModule.js',
'src/*.js'
],
concat: {
dev: {
src: '<%= src %>',
dest: 'modplayer.js'
}
},
uglify: {
prod: {
files: {
'modplayer.min.js': '<%= src %>'
}
}
},
watch: {
js: { files: '<%= src %>', tasks: 'concat' }
}
});
var _ = grunt.util._;
_.each([
'contrib-concat',
'contrib-uglify',
'contrib-watch',
'sync-pkg'
], loadTasks);
_.each({
'default': [ 'concat', 'watch' ],
'build': [ 'concat', 'uglify', 'sync' ]
}, registerTask);
function loadTasks(name) {
grunt.loadNpmTasks('grunt-' + name);
}
function registerTask(tasks, name) {
grunt.registerTask(name, [].concat(tasks));
}
};