In the Adding the Less compiler task recipe, you installed the Less task and read how to configure this task. In the Using CSS source maps to debug your code recipe from Chapter 2, Debugging and Documenting Your Less Code, you can read how to create a v3 CSS source map and use this source map to debug your code. This recipe describes how to create these source maps automatically with the Less compiler task.
The only requirement for this recipe is to have the Less plugin installed and loaded in your Gruntfile.js
file. You can check the Adding the Less compiler task recipe of this chapter to find out how to install this plugin.
Open the Gruntfile.js
file that contains your Less task configuration. The grunt-contrib-less
task has options to turn the source maps on and set the output path. The sourceMap
option is Boolean, which can be set to true
to enable source maps. With only the sourceMap
option set to true
, the...