Daniel Siepmann
a4f1c7c480
Isolate the whole nodejs/yarn stuff. Migrate from node-sass to dart sass in order to do so. Easier to install, less dependencies (no python, no compiling while yarn install)
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const { src, dest, parallel, watch } = require('gulp');
|
|
const sass = require('gulp-dart-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);
|