Gulp. Plugins. Compile SCSS to CSS

Home » Tutorials » Developers tools » 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

Submit a Comment

Your email address will not be published. Required fields are marked *

Подписаться на рассылку

Будьте в курсе - получайте последние статьи на свой email

Ваша подписка успешно оформлена

Pin It on Pinterest

Share This