grunt-sass
Compile Sass to CSS using node-sass
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install grunt-sass 
SYNC missed versions from official npm registry.

grunt-sass Build Status

Compile Sass to CSS using Dart Sass or Node Sass.

Before filing an issue with this repository, please consider:

  • Asking support questions on Use Stack Overflow.

  • Reporting issues with the output on the Dart Sass or LibSass issue trackers, depending which implementation you're using.

  • Reporting installation issues on the Dart Sass or Node Sass issue trackers, depending on which implementation you're using.

Install

$ npm install --save-dev node-sass grunt-sass

Usage

const sass = require('node-sass');

require('load-grunt-tasks')(grunt);

grunt.initConfig({
	sass: {
		options: {
			implementation: sass,
			sourceMap: true
		},
		dist: {
			files: {
				'main.css': 'main.scss'
			}
		}
	}
});

grunt.registerTask('default', ['sass']);

You can choose whether to use Dart Sass or Node Sass by passing the module to the implementation option. One implementation or the other must be passed.

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:

const Fiber = require('fibers');
const sass = require('node-sass');

require('load-grunt-tasks')(grunt);

grunt.initConfig({
	sass: {
		options: {
			implementation: sass,
			fiber: Fiber,
			sourceMap: true
		},
		dist: {
			files: {
				'main.css': 'main.scss'
			}
		}
	}
});

grunt.registerTask('default', ['sass']);

Files starting with _ are ignored to match the expected Sass partial behaviour.

Options

See the Node Sass options, except for file, outFile, success, error.

The default value for the precision option is 10, so you don't have to change it when using Bootstrap.

Current Tags

  • 1.2.0-beta                                ...           beta (9 years ago)
  • 3.1.0                                ...           latest (5 years ago)

43 Versions

  • 3.1.0                                ...           5 years ago
  • 3.0.2                                ...           6 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.2.1                                ...           8 years ago
  • 1.2.0                                ...           9 years ago
  • 1.2.0-beta                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.1.0-beta                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
  • 0.18.1                                ...           10 years ago
  • 0.18.0                                ...           10 years ago
  • 0.17.0                                ...           10 years ago
  • 0.16.1                                ...           10 years ago
  • 0.16.0                                ...           10 years ago
  • 0.15.0                                ...           10 years ago
  • 0.14.2                                ...           10 years ago
  • 0.14.1                                ...           10 years ago
  • 0.14.0                                ...           10 years ago
  • 0.13.1                                ...           10 years ago
  • 0.13.0                                ...           10 years ago
  • 0.12.1                                ...           11 years ago
  • 0.12.0                                ...           11 years ago
  • 0.11.0                                ...           11 years ago
  • 0.10.0                                ...           11 years ago
  • 0.9.0                                ...           11 years ago
  • 0.8.1                                ...           11 years ago
  • 0.8.0                                ...           11 years ago
  • 0.7.0                                ...           11 years ago
  • 0.6.1                                ...           11 years ago
  • 0.6.0                                ...           12 years ago
  • 0.5.0                                ...           12 years ago
  • 0.4.1                                ...           12 years ago
  • 0.4.0                                ...           12 years ago
  • 0.3.0                                ...           12 years ago
  • 0.2.5                                ...           12 years ago
  • 0.2.4                                ...           12 years ago
  • 0.2.3                                ...           12 years ago
  • 0.2.2                                ...           12 years ago
  • 0.2.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (4)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE