gulp sass -npm

Before diving into the procedure, how to install the gulp-sass, we have to make sure that we have installed gulp in our system. Let’s

brush the gulp installation process. If you have not installed before,gulp have to make sure you install it globally first. Start by running,npm install -g gulp

once that has completed we need to add it to our project, type. npm install --save-dev gulp

After installing the gulp we can now start sass installation, Let me remind you that Sass is CSS preprocessor which pretty much reduces the CSS development time.

Sass to CSS conversion is one of the important development activity. Gulp provides `gulp-sass` plugin for this process.

 

Installation

 npm install gulp-sass --save-dev  

Sample Code

 'use strict';  
 var gulp = require('gulp');  
 var sass = require('gulp-sass');  
 gulp.task('sass', function () {  
  return gulp.src('./sass/**/*.scss')  
   .pipe(sass())  
   .pipe(gulp.dest('./css'));  
 });  
 gulp.task('sass:watch', function () {  
  gulp.watch('./sass/**/*.scss', ['sass']);  
 });  

Leave your questions in the comment section, I will try to answer your question and clear your doubts.

Sarav Author

Leave a Reply

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