# broccoli-sass-source-maps

> Libsass-based Sass compiler for Broccoli

Latest version **4.3.0** (published 2024-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-sass-source-maps
pnpm add broccoli-sass-source-maps
yarn add broccoli-sass-source-maps
bun add broccoli-sass-source-maps
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.3.0 |
| Published | 2024-08-07 |
| First published | 2015-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.24.1 |
| Dependencies | 3 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jo Liss |
| Maintainers | knownasilya, aexmachina, stefanpenner, melsumner |
| Keywords | broccoli-plugin, sass, scss, css, libsass |

## Links

- npm: https://www.npmjs.com/package/broccoli-sass-source-maps
- Repository: https://github.com/adopted-ember-addons/broccoli-sass-source-maps
- Homepage: https://github.com/adopted-ember-addons/broccoli-sass-source-maps#readme
- Issues: https://github.com/adopted-ember-addons/broccoli-sass-source-maps/issues
- npm.io page: https://npm.io/package/broccoli-sass-source-maps

## Dependencies (3)

- [rsvp](https://npm.io/package/rsvp.md) ^4.8.5
- [include-path-searcher](https://npm.io/package/include-path-searcher.md) ^0.1.0
- [broccoli-caching-writer](https://npm.io/package/broccoli-caching-writer.md) ^3.0.3

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 4.3.0 (latest) — 2024-08-07
- 4.2.4 — 2023-09-16
- 4.2.3 — 2023-09-14
- 4.2.2 — 2023-09-13
- 4.2.1 — 2023-09-12
- 4.2.0 — 2023-08-14
- 4.1.0 — 2022-10-07
- 4.0.0 — 2018-07-11
- 2.2.0 — 2018-01-14
- 2.1.1 — 2017-11-24
- 2.1.0 — 2017-11-14
- 2.0.0 — 2016-12-23
- 1.8.1 — 2016-08-17
- 1.8.0 — 2016-08-07
- 1.7.0 — 2016-07-28
- … 17 more at https://npm.io/package/broccoli-sass-source-maps/versions

## README

# broccoli-sass

The broccoli-sass plugin compiles `.scss` and `.sass` files with
[Dart Sass][] or [LibSass][].

[Dart Sass]: https://sass-lang.com/dart-sass
[LibSass]: https://sass-lang.com/libsass

This is a fork of broccoli-sass that includes support for more options and provides (partial)
support for source maps by embedding the content of the SASS source files in the source map using `sourcesContent`.

Be aware that the paths in the generated source map not correct, but this module does what I need
until the [underlying issue](https://github.com/sass/libsass/issues/908) is resolved.

## Installation

```bash
npm install --save-dev broccoli-sass-source-maps sass
```

## Usage

```js
var compileSass = require('broccoli-sass-source-maps')(require('sass'));

var outputTree = compileSass(inputTrees, inputFile, outputFile, options);
```

Note that when using Dart Sass, **synchronous compilation is twice as fast as
asynchronous compilation** by default, due to the overhead of asynchronous
callbacks. To avoid this overhead, you can use the [`fibers`][] package to call
asynchronous importers from the synchronous code path. To enable this, pass the
`Fiber` class to the `fiber` option:

[`fibers`]: https://www.npmjs.com/package/fibers

```javascript
var compileSass = require('broccoli-sass-source-maps')(require('sass'));
var Fiber = require('fibers');

var outputTree = compileSass(inputTrees, inputFile, outputFile, {fiber: Fiber});
```


* **`inputTrees`**: An array of trees that act as the include paths for
  Sass. If you have a single tree, pass `[tree]`.

* **`inputFile`**: Relative path of the main `.scss` or `.sass` file to compile.
  Broccoli-sass expects to find this file in the *first* input tree
  (`inputTrees[0]`).

* **`outputFile`**: Relative path of the output CSS file.

* **`options`**: An optional hash of options for libsass and caching writer. 
  * Supported Sass options are:
  `functions`, `indentedSyntax`, `omitSourceMapUrl`, `outputStyle`, `precision`, `quietDeps` (Dart Sass only), `silenceDeprecations` (Dart Sass only)
  `sourceComments`, `sourceMap`, `sourceMapEmbed`, and `sourceMapContents`.
  * Options for caching writer include: `annotation`, `cacheInclude`, and `cacheExclude` (see details [here][bcw-options]).

### Example

```js
var appCss = compileSass(['styles', 'vendor'], 'myapp/app.scss', 'assets/app.css');
```

[bcw-options]: https://github.com/ember-cli/broccoli-caching-writer/tree/979abf92c83af7d625b1fd35c94b4e5f56668b18#new-cachingwriterinputnodes-options

## Choosing the version of Sass

You must specify which version of [Dart Sass][] or [Node Sass][] to use by
passing it as a parameter to the module. Add either `sass` (for Dart Sass) or
`node-sass` to _your_ package.json and then provide that version as a parameter
to the module:

```js
// Uses Dart Sass.
var compileSass = require('broccoli-sass-source-maps')(require('sass'));

// Uses Node Sass.
var compileSass = require('broccoli-sass-source-maps')(require('node-sass'));
```

---
_Source: https://npm.io/package/broccoli-sass-source-maps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
