Gathering detailed insights and metrics for grunt-contrib-sass
Gathering detailed insights and metrics for grunt-contrib-sass
Gathering detailed insights and metrics for grunt-contrib-sass
Gathering detailed insights and metrics for grunt-contrib-sass
npm install grunt-contrib-sass
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (96.99%)
CSS (3.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
848 Stars
208 Commits
141 Forks
31 Watchers
4 Branches
29 Contributors
Updated on Jun 12, 2025
Latest Version
2.0.0
Package Id
grunt-contrib-sass@2.0.0
Size
5.24 kB
NPM Version
6.14.5
Node Version
12.18.2
Published on
Aug 20, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
Compile Sass to CSS
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
1npm install grunt-contrib-sass --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
1grunt.loadNpmTasks('grunt-contrib-sass');
Run this task with the grunt sass
command.
Sass is a preprocessor that adds nested rules, variables, mixins and functions, selector inheritance, and more to CSS. Sass files compile into well-formatted, standard CSS to use in your site or application.
This task requires you to have Ruby and Sass installed. If you're on OS X or Linux you probably already have Ruby installed; test with ruby -v
in your terminal. When you've confirmed you have Ruby installed, run gem install sass
to install Sass.
Note: Files that begin with "_" are ignored even if they match the globbing pattern. This is done to match the expected Sass partial behaviour.
Type: String
Default: auto
Values:
auto
- relative paths where possible, file URIs elsewherefile
- always absolute file URIsinline
- include the source text in the sourcemapnone
- no sourcemapsRequires Sass 3.4.0, which can be installed with gem install sass
Type: Boolean
Default: false
Show a full traceback on error.
Type: Boolean
Default: false
on Windows, otherwise true
Force Unix newlines in written files.
Type: Boolean
Default: false
Just check the Sass syntax, does not evaluate and write the output.
Type: String
Default: nested
Output style. Can be nested
, compact
, compressed
, expanded
.
Type: Number
Default: 5
How many digits of precision to use when outputting decimal numbers.
Type: Boolean
Default: false
Silence warnings and status messages during compilation.
Type: Boolean
Default: false
Make Compass imports available and load project configuration (config.rb
located close to the Gruntfile.js
).
Type: Boolean
Default: false
Emit extra information in the generated CSS that can be used by the FireSass Firebug plugin.
Type: Boolean
Default: false
Emit comments in the generated CSS indicating the corresponding source line.
Type: String|Array
Add a (or multiple) Sass import path.
Type: String|Array
Require a (or multiple) Ruby library before running Sass.
Type: String
Default: .sass-cache
The path to put cached Sass files.
Type: Boolean
Default: false
Don't cache to sassc files.
Type: Boolean
Default: false
Run sass
with bundle exec: bundle exec sass
.
Type: Boolean
Default: false
Only compile changed files.
1grunt.initConfig({
2 sass: { // Task
3 dist: { // Target
4 options: { // Target options
5 style: 'expanded'
6 },
7 files: { // Dictionary of files
8 'main.css': 'main.scss', // 'destination': 'source'
9 'widgets.css': 'widgets.scss'
10 }
11 }
12 }
13});
14
15grunt.loadNpmTasks('grunt-contrib-sass');
16
17grunt.registerTask('default', ['sass']);
1grunt.initConfig({ 2 sass: { 3 dist: { 4 files: { 5 'main.css': 'main.scss' 6 } 7 } 8 } 9});
Instead of concatenating the files, just @import
them into another .sass
file eg. main.scss
.
You can specify multiple destination: source
items in files
.
1grunt.initConfig({
2 sass: {
3 dist: {
4 files: {
5 'main.css': 'main.scss',
6 'widgets.css': 'widgets.scss'
7 }
8 }
9 }
10});
Instead of naming all files you want to compile, you can use the expand
property allowing you to specify a directory. More information available in the grunt docs - Building the files object dynamically
.
1grunt.initConfig({ 2 sass: { 3 dist: { 4 files: [{ 5 expand: true, 6 cwd: 'styles', 7 src: ['*.scss'], 8 dest: '../public', 9 ext: '.css' 10 }] 11 } 12 } 13});
chalk
. Update to docs and project structure.banner
option. Allow using --force
to ignore compile errors. Increase concurrency count from 2
to 4
. Improve Windows support.check
option.update
option.bundleExec
option. Fix os.cpus()
issue. Log sass
command when --verbose
flag is set.banner
option.file.orig.src
if file.src
does not exist and return early to avoid passing non-existent files to sass binary.bundle exec
. Make sure .css
files are compiled with SCSS.this.files
API. Add separator
option.Task submitted by Sindre Sorhus
This file was generated on Thu Aug 20 2020 12:31:17.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More