Umbraco.Community.Smidge
1.0.0
dotnet add package Umbraco.Community.Smidge --version 1.0.0
NuGet\Install-Package Umbraco.Community.Smidge -Version 1.0.0
<PackageReference Include="Umbraco.Community.Smidge" Version="1.0.0" />
<PackageVersion Include="Umbraco.Community.Smidge" Version="1.0.0" />
<PackageReference Include="Umbraco.Community.Smidge" />
paket add Umbraco.Community.Smidge --version 1.0.0
#r "nuget: Umbraco.Community.Smidge, 1.0.0"
#:package Umbraco.Community.Smidge@1.0.0
#addin nuget:?package=Umbraco.Community.Smidge&version=1.0.0
#tool nuget:?package=Umbraco.Community.Smidge&version=1.0.0
Umbraco.Community.Smidge
Overview
This project restores the RuntimeMinifier
functionality to Umbraco v16.1.1+, powered by Smidge. The RuntimeMinifier
was removed in Umbraco v14, and this package reintroduces it for developers who need runtime minification of CSS and JavaScript assets.
Features
- Runtime minification of CSS and JavaScript using Smidge
- Easy integration with Umbraco v16.1.1+
- Configuration options for bundling and cache busting
Installation
- Add the NuGet package to your Umbraco project:
dotnet add package Umbraco.Community.Smidge
- Ensure your project is running Umbraco v16.1.1 or later.
Usage
Add
.AddRuntimeMinifier()
to your UmbracoBuilder:// In your Startup or Program.cs builder.CreateUmbracoBuilder() .AddBackOffice() .AddWebsite() .AddComposers() .AddSlimsy() .AddRuntimeMinifier() .Build();
Use the
IRuntimeMinifier
interface to minify assets at runtime.
Example
// Example usage in a notification handler
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Community.Smidge;
public class CreateBundlesNotificationHandler : INotificationHandler<UmbracoApplicationStartingNotification>
{
private readonly IRuntimeMinifier _runtimeMinifier;
private readonly IRuntimeState _runtimeState;
public CreateBundlesNotificationHandler(IRuntimeMinifier runtimeMinifier, IRuntimeState runtimeState)
{
_runtimeMinifier = runtimeMinifier;
_runtimeState = runtimeState;
}
public void Handle(UmbracoApplicationStartingNotification notification)
{
if (_runtimeState.Level == RuntimeLevel.Run)
{
_runtimeMinifier.CreateJsBundle("core-javascript-bundle",
BundlingOptions.OptimizedNotComposite,
["~/scripts/main.min.js"]);
_runtimeMinifier.CreateCssBundle("core-style-bundle",
BundlingOptions.OptimizedNotComposite,
["~/css/bootstrap.min.css", "~/css/main.min.css"]);
}
}
}
Configuration
- You can customize bundling and cache busting via the provided options classes (
BundlingOptions
,RuntimeMinificationSettings
, etc.). - Refer to the source files for advanced configuration.
Contributing
Contributions are welcome! Please submit issues or pull requests via GitHub.
License
This project is licensed under the MIT License. See the LICENSE
file for details.
Credits
- Smidge by Shannon Deminick
- Umbraco Community
For more information, see the source code and comments in this repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Smidge (>= 4.5.1)
- Smidge.InMemory (>= 4.5.1)
- Smidge.Nuglify (>= 4.5.1)
- Umbraco.Cms.Core (>= 16.1.1)
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.0 | 96 | 7/30/2025 |