Configuring LESS

LESS happens to be written in JavaScript, so installing it can be as easy as downloading its JavaScript library (less.js), linking it to our index.html page, and letting its magic work without having to set up anything else.

Should we do that, then? Not a chance. As we said earlier, delegating the compilation task on the client side would be highly inefficient, especially in a client-intensive Angular 2-based native web app. This is what we're going to do instead:

  • Add a new style.less file to our project.
  • Update our Gulp script to process and compile it, outputting the resulting style.css file into the /wwwroot/ folder.
  • Link the resulting .css file to the /wwwroot/index.html root application file.
  • Make a quick test before starting ...

Get ASP.NET Core and Angular 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.