ruby-sass-loader
Version:
Compile sass/scss files with webpack using the original ruby sass implementation
93 lines (67 loc) • 2.58 kB
Markdown
[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]
Use `style!css!ruby-sass` as the loader in your `webpack.config`. If you want to generate source maps use `css?sourceMap` instead of `css`. Supply any of the options as query string to ruby-sass like `ruby-sass?requires[]=sass-globbing&outputStyle=nested`
Generate source maps.
Enabled the --compass argument.
Controls the --style argument. See [Output Style](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style) for allowed values.
Controls the --load-path argument. See [@-Rules and Directives](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#directives).
Controls the --require argument.
Specify a custom build path. If not given the sass and cache files will be compiled in a temporary directory (os.tmpdir() + '/ruby-sass-loader')
#### outputFile
Specify a custom output filename. If not specified the sass and cache files will be compiled into 'out.css' and 'out.css.map'
#### cwd
Specify a working directory. Defaults to the directory of the sass file.
### Simple example
``` javascript
module.exports = {
module: {
loaders: [
{
test: /\.scss$/,
loader: 'style!css?sourceMap!ruby-sass?sourceMap'
}
]
}
};
```
``` javascript
module.exports = {
entry: [
/* smth */
'./styles/main.scss'
],
module: {
loaders: [
/* some other loaders */
{
test: /\.scss$/,
loader: 'style!css!ruby-sass?outputStyle=expanded' +
'&includePaths[]=' +
path.resolve(__dirname, './node_modules/zurb-foundation/scss') +
'&includePaths[]=' +
path.resolve(__dirname, './styles/') +
'&buildPath=' +
path.resolve(__dirname, './build/') +
'&outputFile=bundle.css'
}
]
}
};
```
`npm install ruby-sass-loader`
[](http://www.opensource.org/licenses/mit-license.php)
[]: https://travis-ci.org/ddelbondio/ruby-sass-loader.svg?branch=master
[]: https://travis-ci.org/ddelbondio/ruby-sass-loader
[]: https://coveralls.io/repos/ddelbondio/ruby-sass-loader/badge.svg?branch=master&service=github
[]: https://coveralls.io/github/ddelbondio/ruby-sass-loader?branch=master