Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pros and cons of node-sass and gulp-sass

I was wondering what are the differences between node-sass and gulp-sass? What are the pros and cons of each version? I see that on www.npmjs.com node-sass has more than double of an advantage in downloads. Does this make it better? Is there a difference in compiling speed?

like image 293
gogo_rulez Avatar asked Mar 29 '16 19:03

gogo_rulez


People also ask

Does gulp-Sass use node sass?

If you're getting a node-sass error, that's because the new version of gulp-sass doesn't include node-sass anymore. What you want to do is swap out node-sass, for plain ol' sass. Update your gulp-sass to the latest stable version. const sass = require('gulp-sass')(require('sass')); // Gulp plugin for Sass compilation.

What is difference between node Sass and Sass?

Node-sass is a library that provides binding for Node. js to LibSass, the C version of the popular stylesheet preprocessor, Sass. It allows you to natively compile . scss files to css at incredible speed and automatically via a connect middleware.

Why node Sass is required?

It enables a developer to create code in another language and translate it into CSS , and it compiles SASS to CSS at an incredible speed. It has introduced various new features like: nesting. data variables.

Is node Sass deprecated?

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.


1 Answers

The difference between them is that gulp-sass has node-sass as a dependency :)

gulp-sass is a plugin for Gulp - an excellent build tool.

And it uses node-sass which it itself is using lib-sass which is a Sass compiler written in C or C++.
That makes it faster than Ruby Sass, but it is not as feature complete I think, but they are pretty close to each other.

I think that the Sass project recently switched from Ruby Sass to LibSass as the 'official' compiler / tool - but don't arrest me on that. :)

The cons of gulp-sass is that you get more than just node-sass - you also get gulp-utils and other things - which is a problem if you are not using Gulp in the first place. ...

And if you are using Gulp, then you are all set with gulp-sass, obviously.

To complicate this answer even further, there is also gulp-ruby-sass which uses Ruby Sass directly.
That means that you have to install Ruby and Sass before you can use it, but you will be able to use Compass and other Ruby Sass stuff with it.
It is going to be slower, though..

like image 86
jacmoe Avatar answered Oct 05 '22 04:10

jacmoe