-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
31 lines (26 loc) · 974 Bytes
/
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
"use strict";
var path = require("path");
var cp = require("child_process");
var gulp = require("gulp");
var del = require("del");
gulp.task("clean", function (callback) {
del([path.join("dist", "*.js")], callback);
});
gulp.task("lint", function (callback) {
cp.exec("npm run lint", function (err, stdout) {
if (err) if (stdout) process.stdout.write(stdout);
callback(err);
});
});
gulp.task("build", function (callback) {
cp.exec("./node_modules/browserify/bin/cmd.js ./exports.js | ./node_modules/uglify-js/bin/uglifyjs > ./dist/fzero.min.js", function (err, stdout) {
if (err) throw err;
if (stdout) process.stdout.write(stdout);
cp.exec("./node_modules/browserify/bin/cmd.js ./exports.js > ./dist/fzero.js", function (err, stdout) {
if (err) throw err;
if (stdout) process.stdout.write(stdout);
callback();
});
});
});
gulp.task("default", ["lint", "build"]);