From 124a73f9576369d2828f607cc3170f66cc23ae16 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Sun, 6 Jul 2025 21:29:35 +0800 Subject: [PATCH] Add Bundling system --- Directory.Packages.props | 12 ++-- common.props | 2 +- lsw.Abp.AntDesignUI.sln | 7 +++ .../BlazorAntDesignThemeScriptContributor.cs | 8 ++- .../BlazorAntDesignThemeStyleContributor.cs | 1 + .../Bundling/BlazorGlobalScriptContributor.cs | 1 - .../Bundling/BlazorGlobalStyleContributor.cs | 2 +- .../AbpAntDesignThemeOptions.cs | 2 +- ...etCoreComponentsWebAntDesignThemeModule.cs | 6 +- .../AbpDynamicLayoutComponentOptions.cs | 17 ++++++ .../Bundling/AbpScripts.razor | 50 +++++++++------- .../Bundling/AbpStyles.razor | 60 ++++++++++++------- ...WebAssemblyAntDesignThemeBundlingModule.cs | 54 +++++++++++++++++ .../BlazorWebAssemblyAntDesignThemeBundles.cs | 14 +++++ ...AssemblyAntDesignThemeScriptContributor.cs | 12 ++++ ...bAssemblyAntDesignThemeStyleContributor.cs | 13 ++++ .../BlazorWebAssemblyScriptContributor.cs | 15 +++++ .../BlazorWebAssemblyStandardBundles.cs | 14 +++++ .../BlazorWebAssemblyStyleContributor.cs | 11 ++++ .../FodyWeavers.xml | 3 + ...WebAssembly.AntDesignTheme.Bundling.csproj | 17 ++++++ 21 files changed, 265 insertions(+), 56 deletions(-) create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpDynamicLayoutComponentOptions.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeBundles.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeScriptContributor.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeStyleContributor.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyScriptContributor.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStandardBundles.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStyleContributor.cs create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/FodyWeavers.xml create mode 100644 modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling.csproj diff --git a/Directory.Packages.props b/Directory.Packages.props index 8d25501..b84fba3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,10 +1,10 @@ - 9.1.3 - 1.4.0 - 9.0.5 - 9.0.5 - 9.0.5 + 9.2.1 + 1.4.2 + 9.0.6 + 9.0.6 + 9.0.6 true @@ -104,6 +104,7 @@ + @@ -137,6 +138,7 @@ + diff --git a/common.props b/common.props index 437c6eb..2ea4b69 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 0.9.7 + 0.9.8 https://raw.githubusercontent.com/realliangshiwei/Lsw.Abp.AntDesignUI/main/icon.png https://github.com/realLiangshiwei/Lsw.Abp.AntDesignUI MIT diff --git a/lsw.Abp.AntDesignUI.sln b/lsw.Abp.AntDesignUI.sln index bf9328e..be38f35 100644 --- a/lsw.Abp.AntDesignUI.sln +++ b/lsw.Abp.AntDesignUI.sln @@ -89,6 +89,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Solution Items", ".Solutio NuGet.Config = NuGet.Config EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling", "modules\AntDesignTheme\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling.csproj", "{9FE3143F-08A8-444F-B6B9-D4533FB57674}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -215,6 +217,10 @@ Global {2B617147-6496-44E9-8D49-B571E7EBF2D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B617147-6496-44E9-8D49-B571E7EBF2D6}.Release|Any CPU.ActiveCfg = Release|Any CPU {2B617147-6496-44E9-8D49-B571E7EBF2D6}.Release|Any CPU.Build.0 = Release|Any CPU + {9FE3143F-08A8-444F-B6B9-D4533FB57674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FE3143F-08A8-444F-B6B9-D4533FB57674}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FE3143F-08A8-444F-B6B9-D4533FB57674}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FE3143F-08A8-444F-B6B9-D4533FB57674}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -257,6 +263,7 @@ Global {2DCCFE7C-4BC5-46F8-8493-82352CE0EE71} = {9F013513-EC16-46DF-BDEF-C9B5F0DA6C12} {90DBF0A4-253D-4E75-8221-17455B404551} = {9F013513-EC16-46DF-BDEF-C9B5F0DA6C12} {2B617147-6496-44E9-8D49-B571E7EBF2D6} = {1F85F600-70F9-4286-B8BD-6A124D9DC43D} + {9FE3143F-08A8-444F-B6B9-D4533FB57674} = {9F013513-EC16-46DF-BDEF-C9B5F0DA6C12} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {783A95E2-ACD4-4E6D-B0FC-1D05ADEB9244} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeScriptContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeScriptContributor.cs index 8fa7daa..4187271 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeScriptContributor.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeScriptContributor.cs @@ -1,8 +1,12 @@ -using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; namespace Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme.Bundling; public class BlazorAntDesignThemeScriptContributor: BundleContributor { - + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/_content/AntDesign/js/ant-design-blazor.js"); + } } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeStyleContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeStyleContributor.cs index e885e03..daffa28 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeStyleContributor.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorAntDesignThemeStyleContributor.cs @@ -7,6 +7,7 @@ public class BlazorAntDesignThemeStyleContributor: BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { + context.Files.AddIfNotContains("/_content/AntDesign/css/ant-design-blazor.css"); context.Files.AddIfNotContains("/_content/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/libs/abp/css/theme.css"); } } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalScriptContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalScriptContributor.cs index 6e4654e..fc85755 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalScriptContributor.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalScriptContributor.cs @@ -9,6 +9,5 @@ public class BlazorGlobalScriptContributor : BundleContributor { context.Files.AddIfNotContains("/_framework/blazor.server.js"); context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); - context.Files.AddIfNotContains("/_content/AntDesign/js/ant-design-blazor.js"); } } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalStyleContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalStyleContributor.cs index 44d0fc6..7f05831 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalStyleContributor.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorGlobalStyleContributor.cs @@ -7,6 +7,6 @@ public class BlazorGlobalStyleContributor : BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { - context.Files.AddIfNotContains("/_content/AntDesign/css/ant-design-blazor.css"); + } } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs index 09f4932..036625b 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs @@ -8,7 +8,7 @@ public class AbpAntDesignThemeOptions public MenuOptions Menu { get; set; } /// - /// 是否启用多标签页 + /// Enable multiple tabs in the application. /// public bool EnableMultipleTabs { get; set; } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs index c413a44..ce90bd8 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs @@ -1,5 +1,5 @@ using Lsw.Abp.AntDesignUI; -using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; @@ -13,5 +13,9 @@ public class AbpAspNetCoreComponentsWebAntDesignThemeModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.Components.Add(typeof(AbpAuthenticationState), null); + }); } } diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpDynamicLayoutComponentOptions.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpDynamicLayoutComponentOptions.cs new file mode 100644 index 0000000..1c00e8e --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpDynamicLayoutComponentOptions.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme; + +public class AbpDynamicLayoutComponentOptions +{ + /// + /// Used to define components that renders in the layout + /// + public Dictionary?> Components { get; set; } + + public AbpDynamicLayoutComponentOptions() + { + Components = new Dictionary?>(); + } +} \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpScripts.razor b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpScripts.razor index 91f9205..cded8e1 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpScripts.razor +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpScripts.razor @@ -1,56 +1,60 @@ -@using Volo.Abp @implements IDisposable @inject IComponentBundleManager BundleManager -@inject PersistentComponentState PersistentComponentState - +@inject PersistentComponentState ApplicationState @if (ScriptFiles != null) { foreach (var file in ScriptFiles) { - + var src = file; + if (!AppBasePath.IsNullOrWhiteSpace()) + { + src = AppBasePath.EnsureEndsWith('/') + file.RemovePreFix("/"); + } + } } @code { + + private const string PrerenderedKey = "abp_script_prerendered"; + [Parameter] public List? WebAssemblyScriptFiles { get; set; } [Parameter] public string? BundleName { get; set; } + [Parameter] + public string? AppBasePath { get; set; } + private List? ScriptFiles { get; set; } - private PersistingComponentStateSubscription persistingSubscription; + private PersistingComponentStateSubscription _persistingSubscription; protected override async Task OnInitializedAsync() { - if (BundleName == null) + _persistingSubscription = ApplicationState.RegisterOnPersisting(Callback); + if (!ApplicationState.TryTakeFromJson(PrerenderedKey, out _)) { - throw new AbpException("The BundleName parameter of the AbpScripts component can not be null!"); - } - - persistingSubscription = PersistentComponentState.RegisterOnPersisting(PersistScriptFiles); - - if (PersistentComponentState.TryTakeFromJson>(nameof(ScriptFiles), out var restoredStyleFiles)) - { - ScriptFiles = restoredStyleFiles; + if (!BundleName.IsNullOrWhiteSpace()) + { + ScriptFiles = (await BundleManager.GetScriptBundleFilesAsync(BundleName!)).ToList(); + } } else { - ScriptFiles = (await BundleManager.GetScriptBundleFilesAsync(BundleName!)).ToList(); - } - - if (WebAssemblyScriptFiles != null) - { - ScriptFiles?.AddRange(WebAssemblyScriptFiles); + if (OperatingSystem.IsBrowser() && WebAssemblyScriptFiles != null) + { + ScriptFiles = WebAssemblyScriptFiles; + } } } - private Task PersistScriptFiles() + private Task Callback() { - PersistentComponentState.PersistAsJson(nameof(ScriptFiles), ScriptFiles); + ApplicationState.PersistAsJson(PrerenderedKey, PrerenderedKey); return Task.CompletedTask; } - public void Dispose() => persistingSubscription.Dispose(); + public void Dispose() => _persistingSubscription.Dispose(); } \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpStyles.razor b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpStyles.razor index cf2edbf..d51aa56 100644 --- a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpStyles.razor +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Bundling/AbpStyles.razor @@ -1,56 +1,74 @@ -@using Volo.Abp @implements IDisposable @inject IComponentBundleManager BundleManager -@inject PersistentComponentState PersistentComponentState - +@inject PersistentComponentState ApplicationState @if (StyleFiles != null) { foreach (var file in StyleFiles) { - + var href = file; + if (!AppBasePath.IsNullOrWhiteSpace()) + { + href = AppBasePath.EnsureEndsWith('/') + file.RemovePreFix("/"); + } + } } @code { + + private const string PrerenderedKey = "abp_style_prerendered"; + [Parameter] public List? WebAssemblyStyleFiles { get; set; } [Parameter] public string? BundleName { get; set; } + [Parameter] + public string? AppBasePath { get; set; } + private List? StyleFiles { get; set; } - private PersistingComponentStateSubscription persistingSubscription; + private PersistingComponentStateSubscription _persistingSubscription; protected override async Task OnInitializedAsync() { - if (BundleName == null) + _persistingSubscription = ApplicationState.RegisterOnPersisting(Callback); + if (!ApplicationState.TryTakeFromJson>(PrerenderedKey, out var scriptFiles)) { - throw new AbpException("The BundleName parameter of the AbpStyles component can not be null!"); - } - - persistingSubscription = PersistentComponentState.RegisterOnPersisting(PersistStyleFiles); - - if (PersistentComponentState.TryTakeFromJson>(nameof(StyleFiles), out var restoredStyleFiles)) - { - StyleFiles = restoredStyleFiles; + if (!BundleName.IsNullOrWhiteSpace()) + { + StyleFiles = (await BundleManager.GetStyleBundleFilesAsync(BundleName!)).ToList(); + } } else { - StyleFiles = (await BundleManager.GetStyleBundleFilesAsync(BundleName!)).ToList(); + StyleFiles = scriptFiles; + if (OperatingSystem.IsBrowser() && StyleFiles != null && WebAssemblyStyleFiles != null) + { + StyleFiles.AddIfNotContains(WebAssemblyStyleFiles); + } } + } - if (OperatingSystem.IsBrowser() && WebAssemblyStyleFiles != null) + private bool _hasRemoveServerStyle = false; + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (!_hasRemoveServerStyle && OperatingSystem.IsBrowser() && WebAssemblyStyleFiles != null) { - StyleFiles?.AddRange(WebAssemblyStyleFiles); + _hasRemoveServerStyle = true; + await Task.Delay(3000); + StyleFiles = WebAssemblyStyleFiles; + StateHasChanged(); } } - private Task PersistStyleFiles() + private Task Callback() { - PersistentComponentState.PersistAsJson(nameof(StyleFiles), StyleFiles); + ApplicationState.PersistAsJson(PrerenderedKey, StyleFiles); return Task.CompletedTask; } - public void Dispose() => persistingSubscription.Dispose(); -} \ No newline at end of file + public void Dispose() => _persistingSubscription.Dispose(); +} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule.cs new file mode 100644 index 0000000..b0c0178 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule.cs @@ -0,0 +1,54 @@ +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Modularity; + +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +[DependsOn( + typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule) +)] +public class AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.GlobalAssets.Enabled = true; + options.GlobalAssets.GlobalStyleBundleName = BlazorWebAssemblyAntDesignThemeBundles.Styles.Global; + options.GlobalAssets.GlobalScriptBundleName = BlazorWebAssemblyAntDesignThemeBundles.Scripts.Global; + + options + .StyleBundles + .Add(BlazorWebAssemblyStandardBundles.Styles.Global, bundle => + { + bundle.AddContributors(typeof(BlazorWebAssemblyStyleContributor)); + }); + + options + .ScriptBundles + .Add(BlazorWebAssemblyStandardBundles.Scripts.Global, bundle => + { + bundle.AddContributors(typeof(BlazorWebAssemblyScriptContributor)); + }); + + options + .StyleBundles + .Add(BlazorWebAssemblyAntDesignThemeBundles.Styles.Global, bundle => + { + bundle + .AddBaseBundles(BlazorWebAssemblyStandardBundles.Styles.Global) + .AddContributors(typeof(BlazorWebAssemblyAntDesignThemeStyleContributor)); + }); + + options + .ScriptBundles + .Add(BlazorWebAssemblyAntDesignThemeBundles.Scripts.Global, bundle => + { + bundle + .AddBaseBundles(BlazorWebAssemblyStandardBundles.Scripts.Global) + .AddContributors(typeof(BlazorWebAssemblyAntDesignThemeScriptContributor)); + }); + + options.MinificationIgnoredFiles.Add("_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"); + }); + } +} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeBundles.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeBundles.cs new file mode 100644 index 0000000..bccdfc7 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeBundles.cs @@ -0,0 +1,14 @@ +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyAntDesignThemeBundles +{ + public static class Styles + { + public static string Global = "BlazorWebAssembly.AntDesignTheme.Global"; + } + + public static class Scripts + { + public static string Global = "BlazorWebAssembly.AntDesignTheme.Global"; + } +} \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeScriptContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeScriptContributor.cs new file mode 100644 index 0000000..64cd2f8 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeScriptContributor.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyAntDesignThemeScriptContributor: BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("_content/AntDesign/js/ant-design-blazor.js"); + } +} \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeStyleContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeStyleContributor.cs new file mode 100644 index 0000000..3d6c884 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyAntDesignThemeStyleContributor.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyAntDesignThemeStyleContributor: BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("_content/AntDesign/css/ant-design-blazor.css"); + context.Files.AddIfNotContains("_content/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/libs/abp/css/theme.css"); + } +} \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyScriptContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyScriptContributor.cs new file mode 100644 index 0000000..69cf6a7 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyScriptContributor.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyScriptContributor : BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"); + context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); + context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js"); + context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/authentication-state-listener.js"); + } +} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStandardBundles.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStandardBundles.cs new file mode 100644 index 0000000..773414b --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStandardBundles.cs @@ -0,0 +1,14 @@ +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyStandardBundles +{ + public static class Styles + { + public static string Global = "BlazorWebAssembly.Global"; + } + + public static class Scripts + { + public static string Global = "BlazorWebAssembly.Global"; + } +} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStyleContributor.cs b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStyleContributor.cs new file mode 100644 index 0000000..d25c5b7 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/BlazorWebAssemblyStyleContributor.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; + +public class BlazorWebAssemblyStyleContributor : BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + } +} diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/FodyWeavers.xml b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/FodyWeavers.xml new file mode 100644 index 0000000..00e1d9a --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling.csproj b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling.csproj new file mode 100644 index 0000000..c2ebf43 --- /dev/null +++ b/modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling.csproj @@ -0,0 +1,17 @@ + + + + + + + net9.0 + true + true + Library + + + + + + +