-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
106 lines (104 loc) · 3.03 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
104
105
106
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: [
"./js/*.css",
"./js/*.js",
"./js/*.map",
"./js/**/*.css",
"./js/**/*.js",
"./js/**/*.map",
],
copy: {
default: {
files: {
"./js/": [
"./lib/jquery-plugin/*",
"./MZ-700/mz700-emu.css",
],
"./js/lib/codemirror.css":
"./node_modules/codemirror/lib/codemirror.css",
}
}
},
ts: {
default: {
files: [
{
src: [
"./MZ-700/mz700-emu.ts",
"./MZ-700/mz700-worker.ts",
"./MZ-700/mz700-emu-ws.ts",
]
},
],
"tsconfig": "./tsconfig.json",
},
},
browserify: {
release: {
files: {
"./js/mz700-emu-ws.js": [
"./js/MZ-700/mz700-emu-ws.js",
],
"./js/mz700-emu.js": [
"./js/MZ-700/mz700-emu.js",
],
"./js/mz700-worker.js": [
"./js/MZ-700/mz700-worker.js",
],
},
},
debug: {
files: {
"./js/mz700-emu-ws.min.js": [
"./js/MZ-700/mz700-emu-ws.js",
],
"./js/mz700-emu.min.js": [
"./js/MZ-700/mz700-emu.js",
],
"./js/mz700-worker.min.js": [
"./js/MZ-700/mz700-worker.js",
],
},
},
},
uglify: {
default: {
files: {
"./js/mz700-emu-ws.min.js": [
"./js/mz700-emu-ws.js",
],
"./js/mz700-emu.min.js": [
"./js/mz700-emu.js",
],
"./js/mz700-worker.min.js": [
"./js/mz700-worker.js",
],
},
options: {
sourceMap: true,
},
},
},
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks("grunt-browserify");
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask("debug", [
"copy",
"ts",
"browserify:debug",
]);
grunt.registerTask("release", [
"copy",
"ts",
"browserify:release",
"uglify",
]);
grunt.registerTask("default", [
"debug",
]);
};