Gulp. Plugins. Compile SCSS to CSS
We continue Gulp learning. Today we’ll consider Gulp plugins necessity, install one of it (for compile Sass to CSS).
You need to install plugins to complete different frontend tasks with Gulp. It is installed as simple npm packages.We’ll use gulp-sass plugin for compile sass to css
Code lesson
const {src, dest, series, watch} = require('gulp');
const sass = require('gulp-sass');
sass.compiler = require('node-sass');
function defaultTask(cb) {
return src('./scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(dest('./css'));
}
exports.default = defaultTask
0 Comments