-
Notifications
You must be signed in to change notification settings - Fork 84
/
gulpfile.js
30 lines (26 loc) · 914 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
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass-embedded'));
const browserSync = require('browser-sync').create();
const sourcemaps = require('gulp-sourcemaps');
const includePaths = [
'node_modules/foundation-sites/scss',
'node_modules/motion-ui/src'
];
function sassBuild() {
return gulp.src(['scss/app.scss'])
.pipe(sourcemaps.init())
.pipe(sass({
includePaths : includePaths,
outputStyle : 'compressed'
}).on('error', sass.logError))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('css'));
};
function serve() {
browserSync.init({server : "./"});
gulp.watch("scss/*.scss", sassBuild);
gulp.watch("*.html").on('change', browserSync.reload);
}
gulp.task('sass', sassBuild);
gulp.task('serve', gulp.series('sass', serve));
gulp.task('default', gulp.series('sass', serve));