Skip to content
Snippets Groups Projects
Commit 6bdbd894 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3371630: Switch compiling SCSS to Webpack ~5, SASS, and PostCSS for the...

Issue #3371630: Switch compiling SCSS to Webpack ~5, SASS, and PostCSS for the Varbase Style Guide module
parent 40c80039
No related branches found
Tags 10.0.0-alpha1
No related merge requests found
let gulp = require('gulp'),
sass = require('gulp-sass')(require('sass'));
postcss = require('gulp-postcss'),
csscomb = require('gulp-csscomb'),
autoprefixer = require('autoprefixer'),
browserSync = require('browser-sync').create();
const paths = {
scss: {
src: 'scss/**/*.scss',
dest: 'css',
watch: 'scss/**/*.scss'
},
js: { }
};
// Compile sass into CSS & auto-inject into browsers.
function compile () {
var sassOptions = {
outputStyle: 'expanded',
indented: true,
indentType: 'space',
indentWidth: 2,
linefeed: 'lf',
sourceMap: false
};
return gulp.src([paths.scss.src])
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(postcss([autoprefixer()]))
.pipe(csscomb())
.pipe(gulp.dest(paths.scss.dest))
.pipe(browserSync.stream());
}
// Watching scss files.
function watch () {
gulp.watch([paths.scss.watch], compile);
}
const build = gulp.series(compile, gulp.parallel(watch));
exports.compile = compile;
exports.watch = watch;
exports.default = build;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment