-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
36 lines (28 loc) · 878 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
32
33
34
35
36
const gulp = require('gulp');
const sass = require('gulp-sass');
const babel = require('gulp-babel');
const browserSync = require('browser-sync').create();
gulp.task('styles', () => {
const files = './client/scss/splash.scss';
return gulp.src(files)
.pipe(sass({
includePaths: './node_modules/'
}).on('error', sass.logError))
.pipe(gulp.dest('./static/css'))
.pipe(browserSync.stream());
});
gulp.task('scripts', () => {
const files = './client/js/splash.js';
return gulp.src(files)
.pipe(babel())
.pipe(gulp.dest('./static/js'))
.pipe(browserSync.stream());
});
gulp.task('watch', () => {
browserSync.init({
proxy: 'localhost:3000'
});
gulp.watch('./client/scss/**/*.scss', ['styles']);
gulp.watch('./server/views/*.html').on('change', browserSync.reload);
});
gulp.task('default', ['styles', 'scripts', 'watch']);