Book Image

LESS WEB DEVELOPMENT COOKBOOK

Book Image

LESS WEB DEVELOPMENT COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Less Web Development Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating CSS source maps with the Less compiler task


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.

Getting ready

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.

How to do it…

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...