An alternative LESS compiler with no setup. Uses the official node.js based LESS compiler under the hood with AutoPrefixer and CSSComb built in. See the change log for changes and road map. Features
Compile on saveAll .less files will automatically be compiled into a .css file nested under it in Solution Explorer after being enabled on the project. By default, compilation is off and that's indicated by a watermark at the bottom right corner of any LESS file. To enable LESS compilation, simply click the watermark and it changes to indicate LESS compilation is "on". For files that are being ignored, the watermark looks like this: All
You can stil reference these files from your own Saving the LESS file will then compile into CSS. The automatic compilation doesn't happen if:
The Output Window shows details about what is being executed to make it easy to troubleshoot any issues. Note that the the solution (.sln) file is updated to reflect that LESS compilation is enabled. Remember to save the solution when prompted to persits the information. Compile all .less filesThe solution node in Solution Explorer has a command to compile all Compiler optionsYou can set any compiler options as defined on the LESS compiler website inside a comment in the // lessc --strict-math=on The default less compiler arguments are: lessc --relative-urls --autoprefix="> 0%" "<file.css>" Here are some examples of the code comments to use in the Source map// lessc --source-map This will produce a Output to other directory// lessc "../wwwroot/css/file.css" Autoprefix// lessc --autoprefix="last 2 versions, > 5%" See Browserlist for description on how to construct the value. CSSComb// lessc --csscomb=zen Available values are MinificationBy default a // no-minify lessc --relative-urls" Combine it all// no-minify lessc --relative-urls --source-map "../wwwroot/css.file.css" This example doesn't minify the output, enables both relative urls and source maps and redirects the output file to a different directory. Compiler default optionsYou can specify the compiler options for the solution, the project or for individual folders by placing a file called The default file cannot contain information about the output file, but all other options can be set. Example: Note that it isn't prefixed with Even though minification isn't technically an option you set on the compiler, you can still opt out of minification like so: ContributeCheck out the contribution guidelines if you want to contribute to this project. For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project. License |