-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
executable file
·32 lines (27 loc) · 1.05 KB
/
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
'use strict';
var gulp = require('gulp'),
Promise = require('es6-promise').Promise,
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat');
gulp.task('sass', function () {
return gulp.src('public_html/style/scss/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('public_html/style/css'))
});
gulp.task('styles', ['sass'], function () {
var stream = gulp.src('public_html/style/css/style.css')
.pipe(concat('style.css'))
.pipe(autoprefixer('last 2 version'))
.pipe(gulp.dest('public_html/style/css'))
.pipe(livereload());
});
gulp.task('watch', ['styles'], function () {
livereload.listen();
gulp.watch(['public_html/style/scss/**/*.scss', 'public_html/style/css/**/*.css'], ['styles']);
gulp.watch(['app/**/*.*', 'public_html/**/*.*', 'uploads/**/*.*']).on('change', function (file) {
livereload.changed(file.path);
});
});
gulp.task('default', ['watch']);