-
Notifications
You must be signed in to change notification settings - Fork 111
/
gulpfile.js
51 lines (44 loc) · 1.28 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
const { src, dest, parallel } = require('gulp');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
const minifyCSS = require('gulp-clean-css');
const browserSync = require('browser-sync');
const useref = require('gulp-useref');
const autoprefixer = require('gulp-autoprefixer');
// Tasks -------------------------------------------------------------------- >
function styles() {
return src('./docs/scss/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer('last 2 versions'))
.pipe(dest('./docs/css'))
.pipe(rename({ suffix: '.min' }))
.pipe(minifyCSS())
.pipe(dest('./build/css/'))
.pipe(browserSync.reload({ stream: true }));
};
function scripts() {
return src('./docs/js/**/*.*')
.pipe(dest('./build/js'));
};
function serve() {
browserSync({
server: {
baseDir: "./docs/"
}
});
};
function html() {
return src('./docs/index.html')
.pipe(useref())
.pipe(dest('./build/'));
};
function img() {
return src('./docs/images/**/*.*')
.pipe(dest('./build/images'));
};
function fonts() {
return src('./docs/fonts/**/*.*')
.pipe(dest('./build/fonts'));
};
exports.serve = parallel(serve, html, styles, scripts, img, fonts);
exports.default = parallel(html, styles, scripts, img, fonts);