forked from astralapp/astral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
58 lines (53 loc) · 1.52 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var gulp = require("gulp");
var browserify = require("browserify");
var babelify = require("babelify");
var riotify = require("riotify");
var source = require("vinyl-source-stream");
var Server = require("karma").Server;
var bourbon = require("node-bourbon");
var notify = require("gulp-notify");
var sass = require("gulp-sass");
gulp.task("js", function () {
return browserify({debug: false, entries: ["resources/assets/js/app.js"]})
.transform(babelify.configure({
extensions: [".js"]
}))
.transform(riotify, {type:"es6"})
.bundle().on("error", function(err){
console.log(err.message);
this.emit("end");
})
.pipe(source("app.bundle.js"))
.pipe(gulp.dest("public/js/"));
});
gulp.task("sass", function(){
gulp.src("resources/assets/sass/app.scss")
.pipe(sass({
includePaths: require("node-bourbon").includePaths,
quiet: true
}).on("error", notify.onError(function (error) {
return "Build Failed: " + error.message;
})))
.pipe(gulp.dest("public/css/"))
});
gulp.task("watch", function(){
gulp.watch(["resources/assets/js/**/*.js", "resources/assets/js/**/*.tag"], ["js"]);
gulp.watch(["resources/assets/sass/**/*.scss"], ["sass"]);
});
gulp.task("test", function (done) {
return new Server({
configFile: __dirname + "/karma.conf.js",
singleRun: true
}, done).start();
});
gulp.task("tdd", function (done) {
new Server({
configFile: __dirname + "/karma.conf.js",
}, done).start();
});
gulp.task("default", [
"js",
"sass",
"tdd",
"watch"
]);