-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (41 loc) · 1.4 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
const gulp = require('gulp');
const { src, dest, watch, series, parallel } = require('gulp');
const concat = require('gulp-concat');
const dartSass = require('gulp-dart-sass'); // Gebruik gulp-dart-sass
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const paths = {
stylesReset: {
src: ['./assets/css/reset/*.scss'],
dest: './dist/',
},
styles: {
src: ['./assets/css/*.scss'],
dest: './dist/',
}
};
function compileResetStyles() {
return src(paths.stylesReset.src)
.pipe(dartSass().on('error', dartSass.logError)) // Gebruik dartSass in plaats van sass
.pipe(postcss([autoprefixer({ flexbox: true }), cssnano()]))
.pipe(concat('reset.min.css'))
.pipe(dest(paths.stylesReset.dest));
}
function compileStyles() {
return src(paths.styles.src)
.pipe(dartSass().on('error', dartSass.logError)) // Gebruik dartSass in plaats van sass
.pipe(postcss([autoprefixer({ flexbox: true }), cssnano()]))
.pipe(concat('bundle.min.css'))
.pipe(dest(paths.styles.dest));
}
function watcher() {
watch(paths.stylesReset.src, parallel(compileResetStyles));
watch(paths.styles.src, parallel(compileStyles));
}
exports.compileStyles = compileStyles;
exports.watcher = watcher;
exports.default = series(
parallel(compileStyles),
watcher
);