ExfSoft.Web.Optimization
1.0.3.1
dotnet add package ExfSoft.Web.Optimization --version 1.0.3.1
NuGet\Install-Package ExfSoft.Web.Optimization -Version 1.0.3.1
<PackageReference Include="ExfSoft.Web.Optimization" Version="1.0.3.1" />
paket add ExfSoft.Web.Optimization --version 1.0.3.1
#r "nuget: ExfSoft.Web.Optimization, 1.0.3.1"
// Install ExfSoft.Web.Optimization as a Cake Addin #addin nuget:?package=ExfSoft.Web.Optimization&version=1.0.3.1 // Install ExfSoft.Web.Optimization as a Cake Tool #tool nuget:?package=ExfSoft.Web.Optimization&version=1.0.3.1
ASP.NET WEB程序的优化功能,可以优化js/css文件。而且可以对原文件名进行加密。当你发布后,访问资源将自动压缩混淆代码。再次访问将从缓存中读取。
使用方法:Web.config中:<add namespace="ExfSoft.Web.Optimization"/>;
网页中:
@Scripts.Render("~/packages/jquery")
@Scripts.Build("~/Scripts/abc-{version}.js")
@Scripts.Build("~/Scripts/test1.js", new { attr = "value" })
@Styles.Build("~/Content/site.css")
在使用@Scripts.Render时需要
第一步:在Global.asax代码里
protected void Application_Start()
{
BundleConfig.RegisterBundles(BundleTable.Bundles); //增加
}
第二步:在App_Start里增加一个文件BundleConfig.cs
public class BundleConfig
{
internal static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/packages/jquery").Include(
"~/Scripts/jQuery.{version}.js"));
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- Microsoft.Web.Infrastructure (>= 1.0.0)
- WebGrease (>= 1.5.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.3.1 | 2,265 | 11/19/2013 |