0

I was wondering on how this file structure was done.

enter image description here

I know how to use dotless, but I don't know how make compiled files under .less file.
Any Idea?

Edit

I have found this question

And I had an idea that, if I would be able to make every .css file sits next to .less file using <DependentUpon> tag, then it could work.

I've been following this tutorial regarding dotless

And I think the solution could be done here:

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
  <Target Name="CompileDotlessCss">
    <ItemGroup>
      <Binaries Include="*.dll;*.exe"/>
    </ItemGroup>

    <!-- Compile dotLess CSS into minified full CSS -->
    <Exec Command="$(ProjectDir)..\[MSBuild]\dotless.Compiler.exe $(ProjectDir)..\css\main.css $(ProjectDir)..\css\main.min.css -m"/>

  </Target>
</Project>

But I don't know how.. Please help!

Edit 2

I think I need to change the question.
So my new question would be, "How can I automatically include generated files using the Exec command in the project, and make those generate .css files as a subfiles of the target .less file?"

Edit 3

Hmmm.. my question could be so confusing to others.. I've found this video on this post and that is what I want. Generate .css files from .less files and make .css file as subfiles of .less, and make it included in the project automatically! But using MSBuild.. Is this possible? Please help! :-)

Edit Final

Okay.. After I read the documentation and use this extension
I realize that, I was doing the old thing above.
So, I don't need to do those stuff above, its all done using web essentials..

So the answer for my question is, to use Web Essentials.

Community
  • 1
  • 1
fiberOptics
  • 6,955
  • 25
  • 70
  • 105
  • You could take a look at how Visual Studio 2012 does it (or WebEssentials if you have 2010). It comes out of the box for 2012 – Kenneth Oct 03 '13 at 13:49
  • @Kenneth Honestly, I don't have idea on how to do that. I'm just new to MSBuild. Take a look at this post http://stackoverflow.com/questions/2176675/visual-studio-precompile-dotless/13607390?noredirect=1#answer-13607390 I think the answer could be found here. – fiberOptics Oct 04 '13 at 02:07
  • @Kenneth Thanks! I got the idea now.. Kindly see my final edit.. – fiberOptics Oct 04 '13 at 04:36

1 Answers1

0

As I think you discovered, Web Essentials can do this automatically. It can also then bundle the generated CSS files into a single file, which is pretty handy too.

http://vswebessentials.com/