This repository has been archived by the owner on Jun 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Gruntfile.js
76 lines (68 loc) · 2.65 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
"use strict";
var fs = require("fs");
module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.initConfig({
jshint: {
all: ["src/core.js", "src/modules/*.js", "src/objects/*.js"],
options: {
curly : true,
eqeqeq : true,
latedef : true,
noarg : true,
noempty : true,
quotmark: "double",
undef : true,
strict : true,
trailing: true,
newcap : false,
browser : true,
node : true,
predef : ["timbre"]
}
},
uglify: {
all: {
options: { sourceMap: "timbre.js.map" },
files: { "timbre.js": ["timbre.dev.js"] }
},
extras: {
options: { preserveComments: 'some' },
files: {
"src/extras/min/audio-jsonp.min.js": ["src/extras/audio-jsonp.js"],
"src/extras/min/cosc.min.js": ["src/extras/cosc.js"],
"src/extras/min/keyboard.min.js": ["src/extras/keyboard.js"],
"src/extras/min/MoogFF.min.js": ["src/extras/MoogFF.js"],
"src/extras/min/mouse.min.js": ["src/extras/mouse.js"],
"src/extras/min/mp3_decode.min.js": ["src/extras/mp3_decode.js"],
"src/extras/min/pico-binder.min.js": ["src/extras/pico-binder.js"],
"src/extras/min/soundfont.min.js": ["src/extras/soundfont.js"],
"src/extras/min/webaudioapi.min.js": ["src/extras/webaudioapi.js"]
}
}
},
watch: {
src: {
files: ["src/core.js", "src/**/*.js"],
tasks: ["jshint"]
}
},
clean: ["timbre.js", "timbre.js.map", "*.html", "ja/*.html"]
});
grunt.registerTask("build", function() {
var build_timbre = require("./build/timbre-builder");
var opts = build_timbre.build();
fs.writeFileSync("timbre.dev.js", opts.source, "utf-8")
console.log("%s - %sKB", opts.version, (opts.size / 1024).toFixed(2));
});
grunt.registerTask("doc", function() {
var DocFileBuilder = require("./build/html-builder").DocFileBuilder;
DocFileBuilder.build_statics();
});
grunt.registerTask("gh-pages", ["clean", "uglify", "doc"]);
grunt.registerTask("default", ["jshint"]);
grunt.registerTask("all", ["default", "build"]);
};