-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
40 lines (34 loc) · 1.24 KB
/
gulpfile.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
"use strict";
var cp = require("child_process");
var join = require("path").join;
var writeStream = require("fs").createWriteStream;
var gulp = require("gulp");
var del = require("del");
var gulp_log = writeStream(join(__dirname, "gulp.log"), {flags : 'w'});
gulp.task("clean", function (callback) {
del(["dist/*"], callback);
});
gulp.task("lint", function (callback) {
var runtests = cp.spawn("npm", ["run", "lint"]);
runtests.stdout.on("data", function (data) {
gulp_log.write(data.toString());
});
runtests.stderr.on("data", process.stdout.write);
runtests.on("close", callback);
});
gulp.task("build", function (callback) {
cp.exec("./node_modules/browserify/bin/cmd.js ./exports.js | "+
"./node_modules/uglify-js/bin/uglifyjs > ./dist/ramble.min.js",
function (err, stdout) {
if (err) return callback(err);
if (stdout) process.stdout.write(stdout);
cp.exec("./node_modules/browserify/bin/cmd.js ./exports.js "+
"> ./dist/ramble.js",
function (err, stdout) {
if (err) return callback(err);
if (stdout) process.stdout.write(stdout);
callback();
});
});
});
gulp.task("default", ["lint", "build"]);