Debugging your code with less.js
When compiling your Less code on the client side and running it in your browser, you won't see any syntax or compile errors in the default situation. The less.js file doesn't compile your code on errors. As a result, you will find your document with no styles. In this recipe, you will learn how to let less.js display errors and understand them.
Getting ready
For this recipe, you need a valid HTML document, a Less file, and the less.js compiler file ready.
How to do it…
- Create the following folder and file structure:

 - Edit the HTML5 file named 
index.htmland make it look as follows:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Use variables in Less</title> <link rel="stylesheet/less" type="text/css" href="less/example.less"> <script type="text/javascript">var less = { env: 'development' };</script> ...