user1189352
user1189352

Reputation: 3885

Do I need less.js if I'm using dotless?

I'm trying to import a bootstrap/angular (made for node)/less theme my company purchased into a ASP.net MVC project from scratch.

The theme uses less, so doing some google searches, I installed "dotless" and "dotless adapter for System.Web.Optimization".

So I'm copying and pasting the references and it errors here:

<!-- prochtml:remove:dist -->
<script type="text/javascript">less = { env: 'development' };</script>
<script type="text/javascript" src="~/assets/plugins/misc/less.js"></script>  <-- Errors Here
<!-- /prochtml -->

It says "LessCssHttpHandler.cs not found". "You need to find LessCssHttpHandler.cs to view the source for the current call stack frame."

I was looking into what "less.js" does.. and i couldn't find a clear cut description but it seems like it makes it so that you're able to use the LESS environment because CSS isn't a current standard like CSS is.

If i'm right in my assumption, do I not need to include "less.js" into my project? Thanks

Upvotes: 2

Views: 161

Answers (1)

haim770
haim770

Reputation: 49123

No. Once the processing is done server-side (using dotLess), no need to include Less.js in the client-side (as data is already received as regular CSS).

Also, if you're using Visual Studio, you can set WebEssentials to automatically compile your Less files upon saving (SomeStyleSheet.less -> SomeStyleSheet.css), then on the client-side you're simply loading regular CSS. That will spare you from both server and client side compilation needs.

Upvotes: 2

Related Questions