Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depends on node-sass #785

Closed
jumodada opened this issue Jan 4, 2021 · 19 comments · Fixed by #802
Closed

Depends on node-sass #785

jumodada opened this issue Jan 4, 2021 · 19 comments · Fixed by #802

Comments

@jumodada
Copy link

jumodada commented Jan 4, 2021

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

@NickSharf
Copy link

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
Copy link

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
Copy link

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

@waltercruz
Copy link

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

@Mister-Hope
Copy link

Mister-Hope commented Feb 23, 2021

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:

  • all the files rewriten in typescript
  • use jest instead of mocha to provide coverage support (now it's 100%)
  • all the related deps has upgraded to latest version

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

  • provide better hint in options by declaration files (with IDE support)
  • add tests with sourcemap and async vesions (gulp-dart-sass just remove them)

@jerrylow
Copy link

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

@Mister-Hope
Copy link

Mister-Hope commented Feb 24, 2021

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
Copy link

jerrylow commented Feb 24, 2021

@Mister-Hope actually, good call.

@daedam
Copy link

daedam commented Mar 18, 2021

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
Copy link

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
Copy link

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
Copy link

kitsunekyo commented Mar 26, 2021

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
Copy link

noppa commented Mar 26, 2021

@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
Copy link

duzun commented Apr 13, 2021

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
Copy link

liuyyki commented Apr 20, 2021

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
Copy link

duzun commented Apr 20, 2021

@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
Copy link

liuyyki commented Apr 20, 2021

@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
Copy link

duzun commented Apr 20, 2021

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.