-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (39 loc) · 1.01 KB
/
gulpfile.js
File metadata and controls
47 lines (39 loc) · 1.01 KB
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
'use strict';
const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const imagemin = require('gulp-imagemin');
const imageResize = require('gulp-image-resize');
const minifyCSS = require('gulp-csso');
const sass = require('gulp-sass');
const css = () => {
return gulp.src('src/static/sass/main.scss')
.pipe(
sass(
{
includePaths: [
'node_modules/normalize.css/'
]
}
).on('error', sass.logError)
)
.pipe(autoprefixer())
.pipe(minifyCSS())
.pipe(gulp.dest('src/static/css'));
};
const img = () => {
return gulp.src('src/static/img_src/*')
.pipe(imageResize({
width : 1260,
upscale : false
}))
.pipe(imagemin())
.pipe(gulp.dest('src/static/img'))
};
const watchSass = () => {
gulp.watch('./src/static/sass/**/*.scss', css);
};
const watch = gulp.series(gulp.parallel(css, img), watchSass);
exports.img = img;
exports.css = css;
exports.watch = watch;
exports.default = gulp.parallel(watch);