forked from phlppschrr/gulp-compass-imagehelper
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
38 lines (31 loc) · 917 Bytes
/
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
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const sassImage = require('..');
const paths = {
images: 'images/**/*.+(jpeg|jpg|png|gif|svg)',
sass: 'sass/**/*.scss',
};
function image() {
return gulp.src(paths.images)
.pipe(sassImage({
// targetFile: '_sass-image.scss',
// template: 'sass-image-template.mustache',
images_path: 'images/',
css_path: 'css/',
prefix: 'icon--',
}))
.pipe(gulp.dest('sass'));
}
function css() {
return gulp.src('sass/main.scss')
.pipe(sass({ errLogToConsole: true }))
.pipe(gulp.dest('./css'));
}
function watch() {
gulp.watch(paths.images, image);
gulp.watch(paths.sass, css);
}
const compile = gulp.series(image, css);
exports.compile = compile;
exports.watch = gulp.series(compile, watch);
exports.default = compile;