dlmanning / gulp-sass

SASS plugin for gulp
MIT License
1.56k stars 381 forks source link

Depends on node-sass #785

Closed jumodada closed 3 years ago

jumodada commented 3 years ago

it is recommended to replace node-sass with dart-sass

NickSharf commented 3 years ago

There is a package based on this project with dart-sass replacement https://www.npmjs.com/package/gulp-dart-sass. Try to use it instead of gulp-sass.

Mister-Hope commented 3 years ago

There is a package based on this project with dart-sass replacement https://www.npmjs.com/package/gulp-dart-sass. Try to use it instead of gulp-sass.

That repo is closing its issue panel. I am fully negative to a 1 contributer forked project without a issue panel.

That means if I meet a bug, I must must read though the code and open a PR. And if no responese, I must fork, fix and publish a package of my own, I would rather fork this repo and implement a package by myself.

Mister-Hope commented 3 years ago

Unless the contributer wants to leave this project deperate in the future, I think it's necessary to switch to sass package.

waltercruz commented 3 years ago

I agree with @Mister-Hope. Please remove the node-sass dependency!

Mister-Hope commented 3 years ago

For anyone wants to use sass and prevent downloading node-sass, here is a plugin:

It's a totlly rewritten version of this repo, inlucding:

It's better than gulp-dart-sass in:

jerrylow commented 3 years ago

Thanks @Mister-Hope I think sass is the way to go and should push for testing and getting #786 in.

Mister-Hope commented 3 years ago

Thanks @Mister-Hope I think sass is the way to go and should push for testing and getting #786 in.

@jerrylow That PR do works, but I still recomand you to use my plugin.

This repo is lack of maintainence for quite a long while. I am using typescript for better option hints, and rewrite the test in typescript using jest to provide coverage support, also all the deps are in it's latest version.

jerrylow commented 3 years ago

@Mister-Hope actually, good call.

daedam commented 3 years ago

I think it is useful that this plugin allows for the choice of node-sass or dart-sass, but it is unfortunate that node-sass is used by default and therefore a dependency. Wouldn't an easy fix be to remove the node-sass dependency, remove the assignment to the compiler property, and update the documentation to instruct users to install their preferred package and set the compiler property manually? Granted, it would be a breaking change, but it would allow this plugin to remain useful for either compiler without requiring node-sass to be installed even when dart-sass is being used.

kitsunekyo commented 3 years ago

please dont forget that node-sass isnt just "cosmetically" deprecated. by using node-sass you miss out on all new sass features like namespaced imports (@use).

https://sass-lang.com/blog/libsass-is-deprecated

so node-sass CANNOT stay in this project unless we want to move this repo to the npm graveyard.

Mister-Hope commented 3 years ago

please dont forget that node-sass isnt just "cosmetically" deprecated. by using node-sass you miss out on all new sass features like namespaced imports (@use).

https://sass-lang.com/blog/libsass-is-deprecated

so node-sass CANNOT stay in this project unless we want to move this repo to the npm graveyard.

Try my plugin🧐

kitsunekyo commented 3 years ago

please dont forget that node-sass isnt just "cosmetically" deprecated. by using node-sass you miss out on all new sass features like namespaced imports (@use). https://sass-lang.com/blog/libsass-is-deprecated so node-sass CANNOT stay in this project unless we want to move this repo to the npm graveyard.

Try my plugin🧐

i prefer open source where we keep the quality of a few packages high, over a million duplicated projects, where most of them are broken and you have to be lucky to pick the "right" one.

gulp-sass already supports dart-sass. i think just the docs need updating, so the examples propose setting the compiler to sass instead.

noppa commented 3 years ago

@kitsunekyo Simple documentation change isn't quite enough - the dependency to node-sass should also be dropped from package.json (which is a breaking change) for this project to remain a viable alternative. The C++ libsass is a horrible transitive dependency to have, even if you don't actually use it at runtime. npm will still try to build it on install and then bursts into flames when some little thing isn't exactly right in the build environment. Just google "node-sass error" and witness the pain.

duzun commented 3 years ago

Besides the pain to build node-sass, there is a pain in trying to avoid loading it. I was trying to use gulp-sass with sass (dart-sass) on node@15:

const sass = require('gulp-sass');
sass.compiler = require('sass');

But gulp-sass is loading node-sass when required, thus throwing an error.

I've made the PR #791 to fix this pain, but now I'm thinking of switching to something else :(

liuyyki commented 3 years ago

Besides the pain to build node-sass, there is a pain in trying to avoid loading it. I was trying to use gulp-sass with sass (dart-sass) on node@15:

const sass = require('gulp-sass');
sass.compiler = require('sass');

But gulp-sass is loading node-sass when required, thus throwing an error.

I've made the PR #791 to fix this pain, but now I'm thinking of switching to something else :(

Hello, In my gulpfile.js I removed this line sass.compiler = require ('sass');

And remove these "node-sass gulp-sass" packages

npm rm node-sass gulp-sass
npm cache clear --force
npm i gulp-sass

And start Gulp, the error was gone. Perhaps the information in the manual for the "gulp-sass" package is not up to date?

Another option is to edit the line sass.compiler = require ('sass'); to sass.compiler = require ('node-sass');

Gulp ran without error too

duzun commented 3 years ago

@alpwe I guess I wasn't clear enough on what my intention is :) I can not run node-sass on node@15, thus I wanted to replace node-sass with dart-sass (package name sass). That is my intention.

Before node@15 your suggestions would help.

liuyyki commented 3 years ago

@duzun Ohh, sory ))) When I tried to install node-sass with node 15.14.0 I got a message in the terminal "node-sass is not supported yet" And I just installed NodeJs LTS (14.6.1) Maybe npm up node-sass will help?

duzun commented 3 years ago

@alpwe unfortunately node-sass states clearly that it is deprecated and there will be no support for new versions of NodeJs. Also, I don't like the idea to keep using node@14 just because some deprecated libraries. Sooner or later it would bite.

ghostdevv commented 3 years ago

Please do this! Needing the newer sass features and unable to have them via node-sass