-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
64 lines (48 loc) · 1.42 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
61
62
63
64
var DEV_URL = 'semi-bold.local';
var DEV_PORT = 3030;
var DEV_BROWSER = 'google chrome';
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('styles', function(done) {
/* Sass it up, pack it up */
gulp.src('sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./'));
done();
});
gulp.task('html', function(done) {
done();
});
gulp.task('php', function(done) {
done();
});
gulp.task('js', function(done) {
done();
});
gulp.task('watch:scss', function(done) {
return gulp.watch('sass/**/*.scss',gulp.series('styles')).on('change', reload);
});
gulp.task('watch:html', function(done) {
return gulp.watch('**/*.html',gulp.series('html')).on('change', reload);
});
gulp.task('watch:php', function(done) {
return gulp.watch('**/*.php',gulp.series('php')).on('change', reload);
});
gulp.task('watch:js', function(done) {
return gulp.watch('js/**/*.js',gulp.series('js')).on('change', reload);
});
gulp.task('sync', function(done) {
browserSync.init({
proxy: DEV_URL,
browser: DEV_BROWSER,
port: DEV_PORT
});
done();
});
gulp.task('watch', gulp.parallel('watch:js', 'watch:scss', 'watch:php', 'watch:html'));
gulp.task('default', gulp.series('styles', 'sync', 'watch'));