Can Asp.net MVC Bundle convert LESS to CSS?

I have a project in Visual Studio 2015 with Asp.Net MVC 5.

All my css and js files link to bundle ( BundleConfigclass + @Styles, @Scriptson cshtml pages).

Now I am considering using a .less file rather than a css file.

So, how will I refer to this file in the kit? And most importantly, can the link (or something else) automatically convert .less to .css, or do I need to do this manually?

+4
source share
1 answer

Mads Kristensen Web Compiler. (VS) MS build!.

, css .LESS . css, .

, , Web Compiler = > Compile file.

enter image description here

css LESS. compilerconfig.json, . , pre/post, .

enter image description here

, Evey LESS JSON config.

[
  {
    "outputFile": "Content/MasterStyles.css",
    "inputFile": "Content/MasterStyles.less"
  },
  {
    "outputFile": "Content/AdminStyles.css",
    "inputFile": "Content/AdminStyles.less"
  }
]

Bundle 2 css, .

. /, json .

+8

Source: https://habr.com/ru/post/1657331/


All Articles