Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio - precompile - dotless

I wonder if there is a way to precompile *.less files(http://www.dotlesscss.org/) with visual studio.

The site gives me a dotless.compiler.exe but I am not sure how to hook this up to visual studio. I am looking for a solution for both Webforms and ASP.NET MVC.

like image 351
Pickels Avatar asked Feb 01 '10 12:02

Pickels


People also ask

How to compile website in Visual Studio?

Open the Book Review WSP in Visual Studio, go to the Build menu, and select the Publish Web Site menu option. This launches the Publish Web Site dialog box (see Figure 1), where you can specify the target location, whether or not the precompiled site's user interface is updatable, and other compiler tool options.

What is precompiled in c#?

When precompiling for deployment, the compilation tool creates a target location folder, compiles the specified web application's source code, and copies these compiled assemblies and the content files into the target location folder.

What does Precompile during publishing do?

The default (checked) setting of "Allow precompiled site to be updateable" allows you to update your view content without needing to rebuild the entire project.

What ASP net deployment method is used to precompile website content before installation?

Performing Precompilation You can precompile a Web site using the Aspnet_compiler.exe tool on the command line. For more information, see How to: Precompile ASP.NET Web Sites for Deployment and ASP.NET Compilation Tool (Aspnet_compiler.exe). Visual Studio also includes commands to precompile a Web site from the IDE.


1 Answers

Depending on your build environment, you can kick off dotless.Compiler.exe as a build task.

For example, using a Pre-Build task in Visual Studio (all 1 line):

$(SolutionDir)Tools\dotLess\dotless.compiler.exe -m      $(ProjectDir)content\css\site.less $(ProjectDir)content\css\site.css 

The macros ($(SolutionDir), etc) allow a bit of flexibility to project and file locations. Rather than using the standard .less files, simply reference the new .css files in your markup.

like image 182
David R. Longnecker Avatar answered Oct 22 '22 21:10

David R. Longnecker