Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mika-f/rust-sass
The Sass compiler wrapper with grass, a Rust implementation, as backend.
https://github.com/mika-f/rust-sass
Last synced: 4 days ago
JSON representation
The Sass compiler wrapper with grass, a Rust implementation, as backend.
- Host: GitHub
- URL: https://github.com/mika-f/rust-sass
- Owner: mika-f
- License: mit
- Created: 2023-02-22T15:29:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-02-23T08:57:11.000Z (over 1 year ago)
- Last Synced: 2024-10-28T16:14:48.933Z (17 days ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@natsuneko-laboratory/rust-sass
- Size: 953 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @natsuneko-laboratory/rust-sass
This package is an alternative to the [`sass`](https://www.npmjs.com/package/sass) package but use [`grass`](https://github.com/connorskees/grass) as Sass compiler.
## Usage
### webpack
```javascript
module.exports = {
module: {
rules: [
// ...
{
test: /\.scss$/,
use: [
// other loaders
{
loader: "sass-loader",
options: {
implementation: require("@natsuneko-laboratory/rust-sass/lib/sass-loader"),
},
},
],
},
],
},
};
```## Why use this package?
- `sass` (JS-compiled) is an easy to use but 2.5x and 10x slower than Dart VM.
- `sass` (Dart VM) is a high-performance but dependent on platform outside of Node.js.## Performance
- `dart` : ~10000ms (10s)
- Run: `pnpm run test:dart`
- `node` : ~2000ms (2s)
- Run: `pnpm run test:node`
- `rust` : ~1500ms (1.5s)
- Run: `pnpm run test:rust`## Publish
```bash
$ npm version [major|minor|patch]
$ git push --follow-tags
```## License
MIT by [@6jz](https://twitter.com/6jz)