-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
65 lines (56 loc) · 1.49 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var jsmin = require('gulp-jsmin');
var htmlbeautify = require('gulp-html-beautify');
var gulp_file_include = require('gulp-file-include');
var browser_sync = require('browser-sync').create();
// SYNC html
gulp.task('include-html', function(){
var options = {
"indent_size": 4
};
gulp.src([
'./html/*.html'
])
.pipe(gulp_file_include())
.pipe(htmlbeautify(options))
.pipe(gulp.dest('./public'))
.pipe(browser_sync.stream());
});
// SYNC sass
gulp.task('sass', function(){
gulp.src(['./sass/*.scss'])
.pipe(sass())
.pipe(gulp.dest('./public/theme/css'))
.pipe(browser_sync.stream());
});
// SYNC js
gulp.task('js', function(){
gulp.src([
'./theme/js/dotstail.js'
])
.pipe(concat('dotstail.min.js'))
.pipe(jsmin())
.pipe(gulp.dest('./public/theme/js'));
});
// COPY images
gulp.task('copy-img', function(){
gulp.src([
'./theme/images/**/*.png',
'./theme/images/**/*.jpg',
'./theme/images/**/*.gif'
])
.pipe(gulp.dest('./public/theme/images'));
});
gulp.task("Sync", ['include-html', 'sass', 'js'], function(){
browser_sync.init({
server: {
baseDir: "./public"
}
});
gulp.watch(['./html/**/*.html',], ['include-html']);
gulp.watch(['./sass/**/*.scss'], ['sass']);
gulp.watch(['./theme/js/*.js'], ['js']);
})
gulp.task('default', ['Sync', 'copy-img']);