-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
38 lines (31 loc) · 898 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
37
38
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var concat = require('gulp-concat');
gulp.task('HTML', function () {
return gulp.src(['./template/header.html', './_index.html', './template/footer.html'])
.pipe(concat({path: 'index.html'}))
.pipe(gulp.dest('./'));
});
gulp.task('SASS', function () {
return gulp.src('./index.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest('./'))
.pipe(browserSync.stream({
match: '*.css'
}));
});
gulp.task('default', function () {
browserSync.init({
server: {
baseDir: './'
},
online: true
});
gulp.watch('./index.scss', ['SASS']);
gulp.watch('./*.html', ['HTML']).on('change', browserSync.reload);
gulp.watch('./*.js').on('change', browserSync.reload);
});