Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-ruby-sass

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ruby-sass

Compile Sass to CSS with Ruby Sass

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
decreased by-7.63%
Maintainers
2
Weekly downloads
 
Created
Source

Deprecated

This project is deprecated because Ruby Sass is deprecated. Switch to gulp-sass.


gulp-ruby-sass Build Status

Compiles Sass with the Sass gem and pipes the results into a gulp stream.
To compile Sass with libsass, use gulp-sass

Install

$ npm install --save-dev gulp-ruby-sass

Requires Sass >=3.4.

Usage

sass(source, [options])

Use gulp-ruby-sass instead of gulp.src to compile Sass files.

const gulp = require('gulp');
const sass = require('gulp-ruby-sass');

gulp.task('sass', () =>
	sass('source/file.scss')
		.on('error', sass.logError)
		.pipe(gulp.dest('result'))
);
source

Type: string string[]

File or glob pattern (source/**/*.scss) to compile. Ignores files prefixed with an underscore. Directory sources are not supported.

options

Type: Object

Object containing plugin and Sass options.

bundleExec

Type: boolean
Default: false

Run Sass with bundle exec.

sourcemap

Type: boolean
Default: false

Initialize and pass Sass sourcemaps to gulp-sourcemaps. Note this option replaces Sass's sourcemap option.

const gulp = require('gulp');
const sass = require('gulp-ruby-sass');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('sass', () =>
	sass('source/file.scss', {sourcemap: true})
		.on('error', sass.logError)
		// for inline sourcemaps
		.pipe(sourcemaps.write())
		// for file sourcemaps
		.pipe(sourcemaps.write('maps', {
			includeContent: false,
			sourceRoot: 'source'
		}))
		.pipe(gulp.dest('result'))
);
base

Type: string

Identical to gulp.src's base option.

tempDir

Type: string
Default: System temp directory

This plugin compiles Sass files to a temporary directory before pushing them through the stream. Use tempDir to choose an alternate directory if you aren't able to use the default OS temporary directory.

emitCompileError

Type: boolean
Default: false

Emit a gulp error when Sass compilation fails.

verbose

Type: boolean
Default: false

Log the spawned Sass or Bundler command. Useful for debugging.

Sass options

Any additional options are passed directly to the Sass executable. The options are camelCase versions of Sass's options parsed by dargs.

Run sass -h for a complete list of Sass options.

gulp.task('sass', () =>
	sass('source/file.scss', {
			precision: 6,
			stopOnError: true,
			cacheLocation: './',
			loadPath: [ 'library', '../../shared-components' ]
		})
		.on('error', sass.logError)
		.pipe(gulp.dest('result'))
);

sass.logError(err)

Convenience function for pretty error logging.

sass.clearCache([tempDir])

In rare cases you may need to clear gulp-ruby-sass's cache. This sync function deletes all files used for Sass caching. If you've set a custom temporary directory in your task you must pass it to clearCache.

Issues

This plugin wraps the Sass gem for the gulp build system. It does not alter Sass's output in any way. Any issues with Sass output should be reported to the Sass issue tracker.

Before submitting an issue please read the contributing guidelines.

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 22 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc