-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
60 lines (51 loc) · 1.47 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
59
60
var gulp = require("gulp");
var sass = require("gulp-sass");
var jade = require("gulp-jade");
var connect = require('gulp-connect');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
gulp.task("sass", function () {
return gulp.src("./app/style.sass")
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest("./public/stylesheets/"));
});
gulp.task("jade", function() {
return gulp.src("./app/index.jade")
.pipe(plumber())
.pipe(jade())
.pipe(gulp.dest("./"));
});
gulp.task("javascript", function() {
return gulp.src("./app/javascript/main.js")
.pipe(plumber())
.pipe(uglify())
.pipe(gulp.dest("./public/javascript"));
});
gulp.task("connect", function() {
connect.server({
root: "public",
livereload: true
});
});
gulp.task("html", function () {
gulp.src("./public/index.html")
.pipe(connect.reload());
});
gulp.task("css", function () {
gulp.src("./public/style.css")
.pipe(connect.reload());
});
gulp.task("images", function () {
gulp.src("./app/images/*")
.pipe(gulp.dest("./public/images/"));
});
gulp.task("watch", function() {
gulp.watch("./app/images/*", ["images"]);
gulp.watch("./app/*.sass", ["sass"]);
gulp.watch("./app/*.jade", ["jade"]);
gulp.watch("./public/index.html", ["html"]);
gulp.watch("./public/style.css", ["css"]);
gulp.watch("./app/javascript/*.js", ["javascript"]);
});
gulp.task("default", ["connect", "sass", "jade", "images", "javascript", "watch"]);