Adding the Sass compiler task
The Sass tasks are the core task that you will need for your Sass development. It has several features and options, but at the heart of it is the Sass compiler that can compile your Sass files into CSS. By the end of this recipe, you will have a good understanding of this plugin, how to add it to your Gruntfile.js
file, and how to take advantage of it.
In this recipe, the grunt-contrib-sass
plugin will be used. This plugin compiles your Sass code by using Ruby Sass. You should use the grunt-sass plugin to compile Sass into CSS with node-sass (LibSass). In Chapter 1, Getting Started with Sass, of this book, you can read about the difference between Ruby Sass and LibSass and how to install Ruby Sass.
Getting ready
The only requirement for this recipe is to have the grunt-contrib-sass plugin installed and loaded in your Gruntfile.js
file. If you have not installed this plugin in the Installing Grunt Plugins recipe of this chapter, you can do this using the following...