-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (34 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
33
34
35
36
37
38
39
40
41
42
43
44
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
sass.compiler = require('sass');
const rename = require('gulp-rename');
const buildCss = async () => {
return await gulp.src('./src/style/index.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist/css'));
}
gulp.task('css:build', buildCss);
const copySass = async () => {
return await gulp.src('./src/style/**/*.scss')
.pipe(gulp.dest('./dist/scss'))
}
gulp.task('sass:copy', copySass);
const buildCssMin = async () => {
return await gulp.src('./src/style/index.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(rename('index.min.css'))
.pipe(gulp.dest('./dist/css'));
}
gulp.task('css:build:min', buildCssMin);
const copyIcons = async () => {
return await gulp.src('./src/icons/*')
.pipe(gulp.dest('./dist/icons'))
}
gulp.task('icons:copy', copyIcons);
gulp.task('default', gulp.series(
'css:build',
'css:build:min',
'sass:copy',
'icons:copy'
));