问题描述
我想知道 node-sass 和 gulp-sass 之间有什么区别?每个版本的优缺点是什么?我在 www.npmjs.com 上看到 node-sass 在下载方面具有两倍多的优势.这是否使它变得更好?编译速度有区别吗?
它们的区别在于 gulp-sass
有 node-sass
作为依赖 :)
gulp-sass
是 Gulp 的插件 - 一个出色的构建工具.>
它使用 node-sass,它本身使用 lib-sass,它是用 C 或 C++ 编写的 Sass 编译器.
这使它比 Ruby Sass 更快,但我认为它的功能并不完整,但它们彼此非常接近.
我认为 Sass 项目最近从 Ruby Sass 切换到 LibSass 作为官方"编译器/工具 - 但不要因此而逮捕我.:)
gulp-sass
的缺点是你得到的不仅仅是 node-sass
- 你还得到 gulp-utils
和其他东西- 如果您一开始就没有使用 Gulp,这将是一个问题....
如果你正在使用 Gulp,那么显然你已经使用了 gulp-sass
.
为了进一步复杂化这个答案,还有 gulp-ruby-sass
直接使用 Ruby Sass.
这意味着您必须先安装 Ruby 和 Sass,然后才能使用它,但您将能够使用 Compass 和其他 Ruby 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?
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..
这篇关于node-sass 和 gulp-sass 的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!