-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
48 lines (42 loc) · 1.22 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
const babel = require("gulp-babel");
const autoprefix = require("gulp-autoprefixer");
const gulp = require("gulp");
const pug = require("gulp-pug");
const stylus = require("gulp-stylus");
const surge = require("gulp-surge");
gulp.task('pug', function() {
return gulp.src(['src/pug/**/*.pug', '!src/pug/includes/*'])
.pipe(pug())
.pipe(gulp.dest('dist/'));
})
gulp.task('stylus', function() {
return gulp.src('src/styl/*.styl')
.pipe(stylus({
compress: true
}))
.pipe(autoprefix({
cascade: false
}))
.pipe(gulp.dest('dist/css'));
})
gulp.task('scripts', function() {
return gulp.src('src/js/*.js')
.pipe(babel({
comments: false,
presets: ['env'],
minified: true
}))
.pipe(gulp.dest('dist/js'))
})
gulp.task('deploy', function() {
return surge({
project: './dist/',
domain: 'projectbeta.surge.sh'
})
})
gulp.task('deployWatch', ['pug', 'stylus', 'scripts', 'deploy'], function() {
gulp.watch(['src/pug/**/*.pug', 'src/styl/**/*.styl', 'src/js/**/*.js'], ['pug', 'stylus', 'scripts', 'deploy']);
})
gulp.task('default', ['pug', 'stylus', 'scripts'], function () {
gulp.watch(['src/pug/**/*.pug', 'src/styl/**/*.styl', 'src/js/**/*.js'], ['pug', 'stylus', 'scripts']);
})