-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
43 lines (37 loc) · 1.1 KB
/
build.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
/* eslint-env node */
"use strict";
var fs = require("fs-extra"),
compressor = require("node-minify");
function foo() {
}
function copyFiles() {
fs.copySync("./src/html/index.html", "./build/index.html");
fs.copySync("./src/api/play.php", "./build/api/play/index.php");
fs.copySync("./src/sounds/play.mp3", "./build/api/play/play.mp3");
fs.copySync("./tmp/birdcam.min.css", "./build/resources/css/birdcam.min.css");
fs.copySync("./tmp/birdcam.min.js", "./build/resources/js/birdcam.min.js");
fs.copySync("./dependencies/fontello", "./build/vendors/fontello");
}
function concatJavascript() {
compressor.minify({
compressor: "no-compress",
input: ["src/js/request.js", "src/js/Observable.js", "src/js/View.js", "src/js/BirdCam.js",
"src/js/BirdCamViewer.js", "src/js/init.js",
],
output: "./tmp/birdcam.min.js",
sync: true,
callback: foo,
});
}
function concatCSS() {
compressor.minify({
compressor: "no-compress",
input: "./src/css/*.css",
output: "./tmp/birdcam.min.css",
sync: true,
callback: foo,
});
}
concatJavascript();
concatCSS();
copyFiles();