Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Snow Man (beta)

Pre-release
Pre-release
Compare
Choose a tag to compare
@am11 am11 released this 24 Dec 09:51
· 1060 commits to master since this release

Welcome to node-sass pre-release: v2.0.0-beta

npm install node-sass@2.0.0-beta

New Features:

  • Custom Importer: is a user-defined function, which libsass calls whenever SASS @import directive (as opposed to CSS3 one) is encountered. It can return result synchronously or asynchronously. Details are present in README. Also, see #44.
  • Custom Importer: available via CLI usage as well. See README under CLI Usage section.
  • sourceMapEmbed option when set to true, it embeds source-maps in CSS sourceMappingURL comment.
  • sourceMapContents option when set to true, it the actual SCSS content in source-map contents[] array.
  • Both node-sass and libsass version info is now displayed via code usage: require('node-sass').info() and also displayed via CLI usage with --help option.
  • In render, error callback now emits object with column info.

Breaking Changes:

The node-sass API is overhauled, which presents some breaking changes:

  • renderFileSync is removed. Use renderSync which accept file, data or both. See examples in README for details.
  • success and error callbacks now return object. Again it is exampled in README.
  • renderSync also returns an object (or in case of error, a JS object literal is printed on standout).
  • stats option is retired. stats object will always be returned as part of result.
  • stats in result does not emit source-map, since we are emitting map as part of result anyway..
  • node-sass does not write output to disk from code usage. It will deliver the output which user can store in file/data-base or generate in-memory HTTP responses.

Known issues:

  • You may find some abnormal behavior, when throttling simultaneous requests when using importers. In which case, please open an issue with detailed, tangible reproduction steps (as I could not isolate the code from our bug suite which is the source of this misbehaviour).
  • In case of incompatible binary (issue #517, //cc @nsams, @laurelnaiad et al.), the installation step would not indicate the problem, but the usage will throw. We revoke this condition, as tests are not passing on Linux. On Windows they pass intermittently due to the aforementioned (throttling) issue. Note that issue #517 is still unresolved.

Gratitude:

Thanks for everyone who provided valuable feedback and contributed in development. Special thanks to:

@mgreter, @xzyfer, @andrew for handful of suggestions and feedback.
@txdv, @rvagg, for enlightening us with libuv and nan tricks and tips, during the implementation of custom importers feature.
@jhnns for giving quality feedback on custom importer and refactoring of v2 API.
@cuongvo: for adding SSL workaround in enterprise environments.
@naartjie updating docs with Workaround for node v0.11.13 v0.11.14
@macbre for updating README with indentationStyle option.