LayerZero.Tools.Web
1.0.1
See the version list below for details.
dotnet add package LayerZero.Tools.Web --version 1.0.1
NuGet\Install-Package LayerZero.Tools.Web -Version 1.0.1
<PackageReference Include="LayerZero.Tools.Web" Version="1.0.1" />
<PackageVersion Include="LayerZero.Tools.Web" Version="1.0.1" />
<PackageReference Include="LayerZero.Tools.Web" />
paket add LayerZero.Tools.Web --version 1.0.1
#r "nuget: LayerZero.Tools.Web, 1.0.1"
#:package LayerZero.Tools.Web@1.0.1
#addin nuget:?package=LayerZero.Tools.Web&version=1.0.1
#tool nuget:?package=LayerZero.Tools.Web&version=1.0.1
📦 LayerZero.Tools.Web – Dynamic Bundle Loader for ASP.NET Core
A convention-based asset bundling system for .NET 8+ using WebOptimizer. Automatically discovers and injects CSS/JS bundles per controller and action using lightweight Razor TagHelpers.
🔍 Purpose
Eliminate manual asset registration by scanning your folder structure and generating optimized bundles dynamically — the right CSS and JS are served per-controller or action, automatically.
🆕 v1.0.1 Highlights
✅ Added
Conditional Minification
Unminified bundles in Development (IWebHostEnvironment.IsDevelopment()
), minified in Production.SpindleTreeGuard
Prevents bundle generation from empty directories using file extension filters like.js
and.css
.
🔧 Changed
Refactored
Register()
Method
Improved clarity, readability, and better conditional logic for dev/prod handling.Cross-Platform Pathing
Normalized directory paths using/
separators for Windows/Linux compatibility.
🛠️ Technical
- Enforced stricter checks to avoid creating unnecessary or empty bundles.
- Reduced noise in dev builds and improved maintainability.
📁 Folder Convention
wwwroot/
├── js/
│ └── controllers/
│ ├── Home/
│ │ ├── index/
│ │ │ ├── tool.js
│ │ │ └── action.js
│ │ └── home.js
│ └── Dashboard/
│ └── overview.js
└── css/
└── controllers/
├── Home/
│ ├── HomeLayout.css
│ └── shared.css
└── Dashboard/
└── overview.css
Your folder structure determines which bundles are auto-generated.
⚙️ Installation
Install via NuGet:
dotnet add package LayerZero.Tools.Web
Add to Program.cs
:
builder.Services.AddSingleton(DynamicBundleMapper.Bundles);
builder.Services.AddWebOptimizer(pipeline =>
{
DynamicBundleMapper.Register(pipeline);
});
Then in Startup.cs
or Program:
app.UseWebOptimizer();
✨ Features
- ✅ Convention-over-configuration
- ✅ Conditional minification (Dev vs Prod)
- ✅ Auto-detects bundles per controller/action
- ✅ Razor TagHelpers for layout injection
- ✅ Clean fallback for empty or missing files
- ✅ Cross-platform path support
🧠 TagHelpers
Add to _ViewImports.cshtml
:
@addTagHelper *, LayerZero.Tools.Web
In _Layout.cshtml
:
<head>
<style-bundle-loader />
</head>
<body>
@RenderBody()
<script-bundle-loader />
</body>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- LayerZero.Tools (>= 1.0.1)
- LigerShark.WebOptimizer.Core (>= 3.0.436)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.