-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (24 loc) · 728 Bytes
/
gulpfile.js
File metadata and controls
28 lines (24 loc) · 728 Bytes
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
const { watch, series, src, dest } = require('gulp');
const rename = require('gulp-rename');
const sass = require('gulp-sass')(require('sass'));
const tildeImporter = require('node-sass-tilde-importer');
const buildCss = () => {
return src('scss/**/*.scss')
.pipe(sass({
importer: tildeImporter,
}).on('error', sass.logError))
.pipe(dest('dist'));
};
const minifyCss = () => {
return src('scss/**/*.scss')
.pipe(sass({
importer: tildeImporter,
outputStyle: 'compressed',
}).on('error', sass.logError))
.pipe(rename({
suffix: '.min'
}))
.pipe(dest('dist'));
};
exports.watch = () => watch('scss/**/*.scss', buildCss);
exports.default = series(buildCss, minifyCss);