-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathgulpfile.babel.js
46 lines (38 loc) · 992 Bytes
/
gulpfile.babel.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
'use strict';
const path = require('path');
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync');
// -------------------------------------------
// Configuration
// -------------------------------------------
const paths = {
src: path.join(__dirname, 'demo/src'),
dist: path.join(__dirname, 'demo/dist'),
};
const patterns = {
sass: path.join(paths.src, '**/*.scss')
};
gulp.task('sass', function () {
return gulp.src('./demo/src/**/*.scss')
.pipe(sass({
outputStyle: 'compressed',
sourceMap: true
}).on('error', sass.logError))
.pipe(gulp.dest('./demo/dist'));
});
gulp.task('browser-sync', () => {
browserSync.init({
server: './demo',
files: [
'demo/dist/**/*.*',
'demo/index.html'
],
browser: 'google chrome',
port: 3003
});
});
gulp.task('watch', ['sass'], () => {
gulp.watch(patterns.sass, ['sass']);
});
gulp.task('server', ['watch', 'browser-sync']);