问题
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?
回答1:
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..
回答2:
This question is better phrased as "what are the differences between Libsass and Ruby Sass" - or any other implementation.
The differences are potentially significant, as they may support different features: see https://sass-compatibility.github.io/
node-sass
uses LibSass under the hood.
In the long run, it looks like Dart Sass is the future: http://sass.logdown.com/posts/2026639-sass-35-is-released
来源:https://stackoverflow.com/questions/36293161/pros-and-cons-of-node-sass-and-gulp-sass