ds-site/gulpfile.js
2020-01-22 08:07:14 +01:00

35 lines
1.1 KiB
JavaScript

const { src, dest, parallel, watch } = require('gulp');
const sass = require('gulp-sass');
const minifyCSS = require('gulp-csso');
const frontendSassFolder = 'Resources/Private/Sass/Frontend/';
const backendSassFolder = 'Resources/Private/Sass/Backend/';
function frontendCss() {
return src(frontendSassFolder + 'index.scss')
.pipe(sass({
includePaths: [
'./node_modules/'
]
}).on('error', sass.logError))
.pipe(minifyCSS())
.pipe(dest('Resources/Public/Css/'))
}
function backendCss() {
return src(backendSassFolder + 'index.scss')
.pipe(sass({
includePaths: [
'./node_modules/'
]
}).on('error', sass.logError))
.pipe(minifyCSS())
.pipe(dest('Resources/Public/Backend/Css/'))
}
exports.frontendCss = frontendCss;
exports.backendCss = backendCss;
exports.watch = function () {
watch([frontendSassFolder + '**/*.scss'], {ignoreInitial: false}, frontendCss);
watch([backendSassFolder + '**/*.scss'], {ignoreInitial: false}, backendCss);
};
exports.default = parallel(frontendCss, backendCss);