-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
64 lines (55 loc) · 1.58 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
var gulp = require('gulp');
var gulp_wait = require('gulp-wait');
var sass = require('gulp-sass');
var cssmin = require('gulp-cssmin');
var gulp_file_include = require('gulp-file-include');
var browser_sync = require('browser-sync').create();
// SYNC SASS
gulp.task('sass', function(){
gulp.src(['./sass/**/*.scss'])
.pipe(sass())
.pipe(cssmin())
.pipe(gulp.dest('./public/theme/css'))
.pipe(browser_sync.stream());
});
// SASS ALL LIBRARY
gulp.task('js', function(){
gulp.src(['./theme/js/*.js'])
.pipe(gulp.dest('./public/theme/js'))
});
// SYNC HTML
gulp.task('include-html', function(){
gulp.src(['./html/*.html'])
.pipe(gulp_wait(1000))
.pipe(gulp_file_include())
.pipe(gulp.dest('./public'))
.pipe(browser_sync.stream());
});
// COPY Site Map
gulp.task('copy-site-map', function() {
gulp.src([
'./html/sitemap/**',
])
.pipe(gulp.dest('./public'));
});
// COPY IMAGES
gulp.task('copy-img', function(){
gulp.src([
'./theme/images/**/*.png',
'./theme/images/**/*.jpg',
'./theme/images/**/*.gif',
'./theme/images/**/*.svg'
])
.pipe(gulp.dest('./public/theme/images'));
});
gulp.task("sync", ['include-html', 'sass', 'js'], function(){
browser_sync.init({
server: {
baseDir: "./public"
}
});
gulp.watch(['./html/**/*.html', './html/html-style/*.css'], ['include-html']);
gulp.watch(['./sass/**/*.scss'], ['sass', 'include-html']);
gulp.watch(['./theme/js/*.js'], ['js', 'include-html']);
})
gulp.task('default', ['sync', 'copy-img', 'copy-site-map']);