Base solution for your next web application
Open Closed

How are .less files build? #2825


User avatar
0
thomasj created

I added Index.less file in the view-resources and it doesn't build an Index.css. How to force build?


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you are not using angular2 version, you need to install this extension <a class="postlink" href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler">https://marketplace.visualstudio.com/it ... ebCompiler</a>.

    Otherwise it should be done by angular-cli.

    Thanks.

  • User Avatar
    0
    tteoh created

    <cite>ismcagdas: </cite> Hi,

    If you are not using angular2 version, you need to install this extension <a class="postlink" href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler">https://marketplace.visualstudio.com/it ... ebCompiler</a>.

    Otherwise it should be done by angular-cli.

    Thanks.

    I found that there are some of the .LESS files is included with .css.map files and some are not. May I know why is it needed and how is it being created?

    Thanks. /Tommy

  • User Avatar
    0
    alper created
    Support Team

    When you use LESS the css is generated by LESS preprocessor. And while you are debugging css files the css maps make output css files more readable and more debuggable even after you have minified withhout impacting performance. If you don't use less for css outputs, then there'll be no map files.

  • User Avatar
    0
    tteoh created

    <cite>alper: </cite> ...... And while you are debugging css files ......

    What do you mean by debugging here? Because I can't replicate what you said. I'm using the web compiler to compile .LESS file but there is only .css file and min.css file. And I got one more question, which is how does the system knows whether to use .css file or min.css file since both of them are compiled by the web compiler?

    I still don't know how the .css.map file is being created.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like WebCompiler only supports generating map files for scss for now. You can check it here <a class="postlink" href="https://github.com/madskristensen/WebCompiler">https://github.com/madskristensen/WebCompiler</a>.

    And I got one more question, which is how does the system knows whether to use .css file or min.css file since both of them are compiled by the web compiler?

    I assume you are using ASP.NET Core version. So, we write css includes between <environment names="Development"> or <environment names="Staging,Production"> tags.

    Thanks.