joe_coolish
joe_coolish

Reputation: 7259

Visual Studio Team Services Compile LESS scripts during build

I'm deploying an ASP.NET Web Application to an Azure Website using VSTS's Continuous Integration. Everything works great except compiling LESS files.

I looked through the build steps and I couldn't find anything specific to LESS. Is there any documentation on how to do this?

Upvotes: 3

Views: 997

Answers (1)

Ageonix
Ageonix

Reputation: 1808

It's pretty easy actually. You just have to set it's build action property to "content" and everything should be good to go.

If that doesn't do the trick, I found this blog post detailing another method to try (note that I haven't tried this technique myself yet):
In Visual Studio, open the properties of your web project, go to the "Build Events" section, and the in the section "Post-build event command line", insert the following line:

$(SolutionDir)\packages\dotless.1.1.0\Tools\dotless.Compiler.exe -m "$(ProjectDir)\content\*.less" "$(ProjectDir)\content\*.css"

Every time the project builds, this command will compile any .less file in the \content folder into a corresponding .css file, minifying it as well (with the -m switch).
Here is the post that contained this information: http://tech-journals.com/jonow/2011/05/13/using-less-css-with-asp-net

Upvotes: 2

Related Questions