-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (31 loc) · 853 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const browsersync = require('browser-sync').create();
const eslint = require('gulp-eslint');
gulp.task('styles', (done) => {
gulp.src('./sass/**/*.scss')
.pipe(sass.sync({
outputStyle: 'compressed',
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
}))
.pipe(gulp.dest('./css'));
done();
});
gulp.task('script', (done) => {
gulp.src('./js/**/*.js')
.pipe(eslint())
.pipe(eslint.format());
done();
});
gulp.task('default', gulp.series('styles', 'script', (done) => {
gulp.watch('./sass/**/*.scss', gulp.series('styles'));
gulp.watch('./js/**/*.js', gulp.series('script'));
browsersync.init({
watch: true,
server: './',
});
done();
}));