Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
488 views
Welcome To Ask or Share your Answers For Others

1 Answer

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)ToolsdotLessdotless.compiler.exe -m 
    $(ProjectDir)contentcsssite.less $(ProjectDir)contentcsssite.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...