Closed brycewray closed 1 year ago
This package doesn't (currently) provide a CLI executable. https://github.com/sass/dart-sass/issues/1889 is tracking the possibility of adding one, but for now this only supports the JS API for using Sass.
https://github.com/sass/dart-sass/issues/1889 is closed. Do we have any info on how to use it as cli?
Fantastic question. We set "bin": {"sass": "./dart-sass/sass"}
in the package.json
for the individual platform packages, but apparently this is not picked up by npm exec
as expected even when running npx sass-embedded-${os}-${arch}
. I'll look into why that is.
In the meantime, you can find the executable manually in node_modules/sass-embedded-${os}-${arch}/dart-sass/sass
.
https://github.com/sass/embedded-host-node/pull/313 should make this much simpler (except on Windows under cmd.exe
or PowerShell, which are blocked by https://github.com/npm/cmd-shim/issues/152). Once that lands, you'll be able to run npx sass
, or just sass
if you've installed the package with npm install -g sass-embedded
.
I apologize in advance if this is a dumb question, but I have searched in vain for the answer. Given that this is supposed to be an alternative to the
sass
package, I’m unclear on how it can be used in a similar way. For example, once thesass
package is installed, apackage.json
script can use it; e.g.,. . . but I can find no analogous documentation, or references within any of the existing issues, to how one uses
embedded-host-node
similarly. I understand that its purpose is to download the appropriate binary but, beyond that, it’s not clear how one should proceed, so I would greatly appreciate any guidance on this score. (If it matters, this would be for use with a Hugo project that already uses npm packages and, thus,package.json
scripts — but more general information would also be helpful.)