-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
34 lines (27 loc) · 919 Bytes
/
gulpfile.js
File metadata and controls
34 lines (27 loc) · 919 Bytes
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
/* File: gulpfile.js */
const gulp = require('gulp')
const gutil = require('gulp-util')
const sass = require('gulp-sass')
const browserSync = require('browser-sync').create()
const babel = require('gulp-babel')
gulp.task('serve', ['sass'], () => {
browserSync.init({
server: '.',
port: 3005,
})
gulp.watch('./stylesheets/scss/*.scss', ['sass'])
gulp.watch(['app/**/*.html']).on('change', browserSync.reload)
gulp.watch('app/**/*.js', ['babel']).on('change', browserSync.reload)
});
gulp.task('sass', () => {
return gulp.src("./stylesheets/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("./stylesheets/css"))
.pipe(browserSync.stream())
})
gulp.task('babel', () => {
return gulp.src('app/**/*.js')
.pipe(babel({ presets: ['es2015'] }))
.pipe(gulp.dest('build'))
})
gulp.task('default', ['serve'])