Skip to content

Commit

Permalink
Merged PR 11119: Fix bundler issue
Browse files Browse the repository at this point in the history
Fixes an error that is thrown when running Umbraco in production mode. In production mode, the assets used to be processed by smidge, causing a minification error.
  • Loading branch information
D-Inventor committed Dec 18, 2023
1 parent 6066c3b commit 59bbd19
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Manifest;

namespace Infocaster.Umbraco.IcomoonPicker.Assets
{
internal class IcomoonManifestFilter
: IManifestFilter
{
public void Filter(List<PackageManifest> manifests)
{
manifests.Add(new PackageManifest
{
PackageName = "Icomoon icon picker",
Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0",
Scripts = new[]
{
Defaults_IcomoonPicker.PluginBasePath + "/script.iife.js"
},
BundleOptions = BundleOptions.None
});
}
}
}
17 changes: 0 additions & 17 deletions src/Infocaster.Umbraco.IcomoonPicker/Assets/ScriptAsset.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Infocaster.Umbraco.IcomoonPicker.Assets;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

Expand All @@ -8,8 +9,8 @@ public class IcomoonPickerComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.BackOfficeAssets()
.Append<ScriptAsset>();
builder.ManifestFilters()
.Append<IcomoonManifestFilter>();
builder.Services.AddHttpClient();
}
}
Expand Down

0 comments on commit 59bbd19

Please sign in to comment.