在.NET Core中编译Sass文件 [英] Compile Sass Files in .NET Core
问题描述
我正在尝试将Sass文件添加到Visual Studio 2017中的.NET Core应用程序.但是,一旦创建它们,我将找不到任何方法来编译.scss文件.我通过NPM和Bower进行了筛选,但均未提供对Sass的支持.
I am trying to add Sass files to my .NET Core application in Visual Studio 2017. However, I cannot find any way to compile .scss files once I've made them. I sifted through NPM and Bower, but neither offer support for Sass.
用于添加Sass的Microsoft文档( https://docs.microsoft.com/zh-cn/aspnet/core/client-side/less-sass-fa )已过时,并假定该项目具有package.json文件.对于为我的项目启用Sass编译的任何指导将不胜感激.
The Microsoft documentation for adding Sass (https://docs.microsoft.com/en-us/aspnet/core/client-side/less-sass-fa) is outdated, and assumes that the project has a package.json file. Any guidance on enabling Sass compiling for my project would be much appreciated.
推荐答案
将.scss添加到ASP.NET Core应用程序的最简单方法是转到Nuget软件包管理器,然后安装LigerShark.WebOptimizer.Core和LigerShark.WebOptimizer.萨斯
The easiest way to add .scss to your ASP.NET Core apps is by going to the Nuget Package Manager and installing LigerShark.WebOptimizer.Core and LigerShark.WebOptimizer.Sass
在那之后,您可以放下
<link rel="stylesheet" href="~/css/site.scss" />
位于_Layout.cshtml文件的头部,并且LigerShark.WebOptimizer.Sass软件包将自动编译所有sass文件.
in the head of the _Layout.cshtml file and the LigerShark.WebOptimizer.Sass package will compile all of your sass files automatically.
这篇关于在.NET Core中编译Sass文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!