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

grunt-sass

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-sass

Compile Sass to CSS using node-sass

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
157K
increased by5.01%
Maintainers
2
Weekly downloads
 
Created

What is grunt-sass?

The grunt-sass npm package is a Grunt plugin for compiling Sass to CSS using the node-sass library. It allows you to integrate Sass compilation into your Grunt build process, providing a streamlined way to manage your stylesheets.

What are grunt-sass's main functionalities?

Basic Sass Compilation

This feature allows you to compile a single Sass file (main.scss) into a CSS file (main.css). The configuration is set up in the Gruntfile.js, and the 'sass' task is registered as the default task.

{
  "grunt.initConfig": {
    "sass": {
      "dist": {
        "files": {
          "'main.css'": "'main.scss'"
        }
      }
    }
  },
  "grunt.loadNpmTasks": "'grunt-sass'",
  "grunt.registerTask": "'default', ['sass']"
}

Multiple File Compilation

This feature allows you to compile multiple Sass files from a directory (sass) into a corresponding directory (css). The 'expand' option is used to enable dynamic file mapping.

{
  "grunt.initConfig": {
    "sass": {
      "dist": {
        "files": [
          {
            "expand": true,
            "cwd": "'sass'",
            "src": ["'*.scss'"],
            "dest": "'css'",
            "ext": "'.css'"
          }
        ]
      }
    }
  },
  "grunt.loadNpmTasks": "'grunt-sass'",
  "grunt.registerTask": "'default', ['sass']"
}

Source Maps

This feature enables the generation of source maps for the compiled CSS, which helps in debugging by mapping the CSS back to the original Sass source.

{
  "grunt.initConfig": {
    "sass": {
      "dist": {
        "options": {
          "sourceMap": true
        },
        "files": {
          "'main.css'": "'main.scss'"
        }
      }
    }
  },
  "grunt.loadNpmTasks": "'grunt-sass'",
  "grunt.registerTask": "'default', ['sass']"
}

Other packages similar to grunt-sass

Keywords

FAQs

Package last updated on 14 Aug 2019

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