[英]Using LESS with MVC5 in Visual Studio 2013 with Web Essentials
I have installed Visual Studio 2013 with Update 2 and installed Web Essentials. 我已经安装了Visual Studio 2013和Update 2并安装了Web Essentials。
I had thought this was going to make adding LESS to my views a piece of cake, but am missing something. 我原本以为这会让我的意见增加一点蛋糕,但我错过了一些东西。
The editor is great, and I imagine that it is compiling to css on save... 编辑很棒,我想它正在编译为css on save ...
But I don't know where the generated css is, and I don't have any clue as to how to get it reference in my view. 但是我不知道生成的css在哪里,我也没有任何关于如何在我看来引用它的线索。
I've tried a lot of searching, but can't get through the web of links about installing this and the features of that. 我已经尝试了很多搜索,但是无法通过网络链接来安装这个以及它的功能。
Any help at all will be greatly appreciated. 任何帮助都将非常感谢。
Thanks! 谢谢!
When you add a .less file and save, the Web Essentials will compile and generate the .css and .min.css files. 添加.less文件并保存时,Web Essentials将编译并生成.css和.min.css文件。 You will see an arrow in your solution explorer, or you can also confirm in your file system that the files are in the same folder.
您将在解决方案资源管理器中看到一个箭头,或者您也可以在文件系统中确认这些文件位于同一文件夹中。
Haven't used less with vs2013 but I have used sass and my guess would be the same. 与vs2013没有用得少,但我使用了sass,我的猜测是一样的。 By default the generated css gets generated in the same directory as the source (as it seemed to me) but you can check via tools>options>web essentials and there should be a set of options for less compile on save, build and directory to name but a few.
默认情况下,生成的css在与源相同的目录中生成(在我看来),但您可以通过工具>选项> web essentials进行检查,并且应该有一组选项,以便在save,build和directory上进行较少的编译。仅举几例。
If you right click on the solution there should be an option to create a web essentials settings file for the solution - these create and adds a json file of web essentials settings to the solution which means your settings are local to the solution which could be important if you are changing the output directory. 如果您右键单击解决方案,则应该有一个选项来为解决方案创建Web Essentials设置文件 - 这些创建并向解决方案添加web essentials设置的json文件,这意味着您的设置是解决方案的本地设置,这可能很重要如果要更改输出目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.