ds-site/gulpfile.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-11-13 23:40:26 +01:00
const { src, dest, parallel, watch } = require('gulp');
const sass = require('gulp-dart-sass');
2019-11-13 23:40:26 +01:00
const minifyCSS = require('gulp-csso');
2020-01-21 17:28:29 +01:00
const frontendSassFolder = 'Resources/Private/Sass/Frontend/';
const backendSassFolder = 'Resources/Private/Sass/Backend/';
2019-11-13 23:40:26 +01:00
2020-01-21 17:28:29 +01:00
function frontendCss() {
return src(frontendSassFolder + 'index.scss')
2019-11-13 23:40:26 +01:00
.pipe(sass({
includePaths: [
'./node_modules/'
]
}).on('error', sass.logError))
.pipe(minifyCSS())
.pipe(dest('Resources/Public/Css/'))
}
2020-01-21 17:28:29 +01:00
function backendCss() {
return src(backendSassFolder + 'index.scss')
.pipe(sass({
includePaths: [
'./node_modules/'
]
}).on('error', sass.logError))
.pipe(minifyCSS())
.pipe(dest('Resources/Public/Backend/Css/'))
}
2019-11-13 23:40:26 +01:00
2020-01-21 17:28:29 +01:00
exports.frontendCss = frontendCss;
exports.backendCss = backendCss;
2019-11-13 23:40:26 +01:00
exports.watch = function () {
2020-01-21 17:28:29 +01:00
watch([frontendSassFolder + '**/*.scss'], {ignoreInitial: false}, frontendCss);
watch([backendSassFolder + '**/*.scss'], {ignoreInitial: false}, backendCss);
2019-11-13 23:40:26 +01:00
};
2020-01-21 17:28:29 +01:00
exports.default = parallel(frontendCss, backendCss);