diff --git a/Directory.Packages.props b/Directory.Packages.props
index 2b76545050..5edba60ff5 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -61,6 +61,8 @@
+
+
diff --git a/build/common.ps1 b/build/common.ps1
index 85f18edb21..e2ba5c5566 100644
--- a/build/common.ps1
+++ b/build/common.ps1
@@ -23,6 +23,11 @@ $solutionPaths = @(
"../modules/blob-storing-database"
)
+ # Remove MAUI related projects if not on Windows
+if ($env:OS -ne "Windows_NT") {
+ dotnet sln ../framework/Volo.Abp.sln remove ../framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj
+}
+
if ($full -eq "-f")
{
# List of additional solutions required for full build
diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln
index c3ca5b63b2..c0454d3edf 100644
--- a/framework/Volo.Abp.sln
+++ b/framework/Volo.Abp.sln
@@ -470,6 +470,7 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling.csproj", "{2F9BA650-395C-4BE0-8CCB-9978E753562A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj", "{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google", "src\Volo.Abp.BlobStoring.Google\Volo.Abp.BlobStoring.Google.csproj", "{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google.Tests", "test\Volo.Abp.BlobStoring.Google.Tests\Volo.Abp.BlobStoring.Google.Tests.csproj", "{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}"
@@ -480,6 +481,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.TencentCloud",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.TencentCloud.Tests", "test\Volo.Abp.Sms.TencenCloud.Tests\Volo.Abp.Sms.TencentCloud.Tests.csproj", "{C753DDD6-5699-45F8-8669-08CE0BB816DE}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Bundling", "src\Volo.Abp.AspNetCore.Bundling\Volo.Abp.AspNetCore.Bundling.csproj", "{75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling", "src\Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj", "{70720321-DED4-464F-B913-BDA5BBDD7982}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1434,6 +1439,14 @@ Global
{C753DDD6-5699-45F8-8669-08CE0BB816DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C753DDD6-5699-45F8-8669-08CE0BB816DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C753DDD6-5699-45F8-8669-08CE0BB816DE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {70720321-DED4-464F-B913-BDA5BBDD7982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {70720321-DED4-464F-B913-BDA5BBDD7982}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {70720321-DED4-464F-B913-BDA5BBDD7982}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70720321-DED4-464F-B913-BDA5BBDD7982}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1676,6 +1689,8 @@ Global
{E50739A7-5E2F-4EB5-AEA9-554115CB9613} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{BE7109C5-7368-4688-8557-4A15D3F4776A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{C753DDD6-5699-45F8-8669-08CE0BB816DE} = {447C8A77-E5F0-4538-8687-7383196D04EA}
+ {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
+ {70720321-DED4-464F-B913-BDA5BBDD7982} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}
diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj
new file mode 100644
index 0000000000..2654005740
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ net9.0
+ enable
+ Nullable
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs
new file mode 100644
index 0000000000..5e4967719f
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs
@@ -0,0 +1,15 @@
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.Minify;
+using Volo.Abp.Modularity;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Bundling;
+
+[DependsOn(
+ typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule),
+ typeof(AbpMinifyModule),
+ typeof(AbpVirtualFileSystemModule)
+)]
+public class AbpAspNetCoreBundlingModule : AbpModule
+{
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs
similarity index 88%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs
index e00bc84d6c..5ade7fc088 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs
@@ -1,9 +1,10 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.DependencyInjection;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public class BundleCache : IBundleCache, ISingletonDependency
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs
similarity index 79%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs
index f6830cbd74..f75f8b66db 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs
@@ -1,7 +1,8 @@
using System;
using System.Collections.Generic;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public class BundleCacheItem
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs
new file mode 100644
index 0000000000..8563918113
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs
@@ -0,0 +1,248 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling.Scripts;
+using Volo.Abp.AspNetCore.Bundling.Styles;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Bundling;
+
+public abstract class BundleManagerBase : IBundleManager
+{
+ public ILogger Logger { get; set; }
+
+ protected readonly AbpBundlingOptions Options;
+ protected readonly AbpBundleContributorOptions ContributorOptions;
+ protected readonly IScriptBundler ScriptBundler;
+ protected readonly IStyleBundler StyleBundler;
+ protected readonly IServiceProvider ServiceProvider;
+ protected readonly IDynamicFileProvider DynamicFileProvider;
+ protected readonly IBundleCache BundleCache;
+
+ public BundleManagerBase(
+ IOptions options,
+ IOptions contributorOptions,
+ IScriptBundler scriptBundler,
+ IStyleBundler styleBundler,
+ IServiceProvider serviceProvider,
+ IDynamicFileProvider dynamicFileProvider,
+ IBundleCache bundleCache)
+ {
+ Options = options.Value;
+ ContributorOptions = contributorOptions.Value;
+ ScriptBundler = scriptBundler;
+ ServiceProvider = serviceProvider;
+ DynamicFileProvider = dynamicFileProvider;
+ BundleCache = bundleCache;
+ StyleBundler = styleBundler;
+
+ Logger = NullLogger.Instance;
+ }
+
+ public virtual async Task> GetStyleBundleFilesAsync(string bundleName)
+ {
+ return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler);
+ }
+
+ public virtual async Task> GetScriptBundleFilesAsync(string bundleName)
+ {
+ return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler);
+ }
+
+ protected virtual async Task> GetBundleFilesAsync(BundleConfigurationCollection bundles,
+ string bundleName, IBundler bundler)
+ {
+ var files = new List();
+
+ var contributors = GetContributors(bundles, bundleName);
+ var bundleFiles = await GetBundleFilesAsync(contributors);
+ var dynamicResources = await GetDynamicResourcesAsync(contributors);
+
+ if (!IsBundlingEnabled())
+ {
+ return bundleFiles.Union(dynamicResources).ToImmutableList();
+ }
+
+ var localBundleFiles = new List();
+ foreach (var bundleFile in bundleFiles)
+ {
+ if (!bundleFile.IsExternalFile)
+ {
+ localBundleFiles.Add(bundleFile.FileName);
+ }
+ else
+ {
+ if (localBundleFiles.Count != 0)
+ {
+ files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files);
+ localBundleFiles.Clear();
+ }
+
+ files.Add(bundleFile);
+ }
+ }
+
+ if (localBundleFiles.Count != 0)
+ {
+ files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files);
+ }
+
+ return files.Union(dynamicResources).ToImmutableList();
+ }
+
+ private BundleCacheItem AddToBundleCache(string bundleName, IBundler bundler, List bundleFiles)
+ {
+ var bundleRelativePath =
+ Options.BundleFolderName.EnsureEndsWith('/') +
+ bundleName + "." + bundleFiles.JoinAsString("|").ToMd5() + "." + bundler.FileExtension;
+
+ return BundleCache.GetOrAdd(bundleRelativePath, () =>
+ {
+ var cacheValue = new BundleCacheItem(
+ new List { new BundleFile("/" + bundleRelativePath) }
+ );
+
+ WatchChanges(cacheValue, bundleFiles, bundleRelativePath);
+
+ var bundleResult = bundler.Bundle(
+ new BundlerContext(
+ bundleRelativePath,
+ bundleFiles,
+ IsMinficationEnabled()
+ )
+ );
+
+ SaveBundleResult(bundleRelativePath, bundleResult);
+
+ return cacheValue;
+ });
+ }
+
+ private void WatchChanges(BundleCacheItem cacheValue, List files, string bundleRelativePath)
+ {
+ lock (cacheValue.WatchDisposeHandles)
+ {
+ foreach (var file in files)
+ {
+ var watchDisposeHandle = GetFileProvider().Watch(file).RegisterChangeCallback(_ =>
+ {
+ lock (cacheValue.WatchDisposeHandles)
+ {
+ cacheValue.WatchDisposeHandles.ForEach(h => h.Dispose());
+ cacheValue.WatchDisposeHandles.Clear();
+ }
+
+ BundleCache.Remove(bundleRelativePath);
+ DynamicFileProvider.Delete("/wwwroot/" + bundleRelativePath); //TODO: get rid of wwwroot!
+ }, null);
+
+ cacheValue.WatchDisposeHandles.Add(watchDisposeHandle);
+ }
+ }
+ }
+
+ protected virtual void SaveBundleResult(string bundleRelativePath, BundleResult bundleResult)
+ {
+ var fileName = bundleRelativePath.Substring(bundleRelativePath.IndexOf('/') + 1);
+
+ DynamicFileProvider.AddOrUpdate(
+ new InMemoryFileInfo(
+ "/wwwroot/" + bundleRelativePath, //TODO: get rid of wwwroot!
+ Encoding.UTF8.GetBytes(bundleResult.Content),
+ fileName
+ )
+ );
+ }
+
+ public abstract bool IsBundlingEnabled();
+
+
+ protected abstract bool IsMinficationEnabled();
+
+ protected virtual async Task> GetBundleFilesAsync(List contributors)
+ {
+ var context = CreateBundleConfigurationContext();
+
+ foreach (var contributor in contributors)
+ {
+ await contributor.PreConfigureBundleAsync(context);
+ }
+
+ foreach (var contributor in contributors)
+ {
+ await contributor.ConfigureBundleAsync(context);
+ }
+
+ foreach (var contributor in contributors)
+ {
+ await contributor.PostConfigureBundleAsync(context);
+ }
+
+ return context.Files;
+ }
+
+ protected virtual async Task> GetDynamicResourcesAsync(List contributors)
+ {
+ var context = CreateBundleConfigurationContext();
+
+ foreach (var contributor in contributors)
+ {
+ await contributor.ConfigureDynamicResourcesAsync(context);
+ }
+
+ return context.Files;
+ }
+
+ protected virtual BundleConfigurationContext CreateBundleConfigurationContext()
+ {
+ return new BundleConfigurationContext(ServiceProvider, GetFileProvider(),
+ Options.Parameters);
+ }
+
+ protected abstract IFileProvider GetFileProvider();
+
+ protected virtual List GetContributors(BundleConfigurationCollection bundles, string bundleName)
+ {
+ var contributors = new List();
+
+ AddContributorsWithBaseBundles(contributors, bundles, bundleName);
+
+ for (var i = 0; i < contributors.Count; ++i)
+ {
+ var extensions = ContributorOptions.Extensions(contributors[i].GetType()).GetAll();
+ if (extensions.Count > 0)
+ {
+ contributors.InsertRange(i + 1, extensions);
+ i += extensions.Count;
+ }
+ }
+
+ return contributors;
+ }
+
+ protected virtual void AddContributorsWithBaseBundles(List contributors,
+ BundleConfigurationCollection bundles, string bundleName)
+ {
+ var bundleConfiguration = bundles.Get(bundleName);
+
+ foreach (var baseBundleName in bundleConfiguration.BaseBundles)
+ {
+ AddContributorsWithBaseBundles(contributors, bundles, baseBundleName); //Recursive call
+ }
+
+ var selfContributors = bundleConfiguration.Contributors.GetAll();
+
+ if (selfContributors.Any())
+ {
+ contributors.AddRange(selfContributors);
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs
similarity index 75%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs
index eb44dd585e..60ac2c0bc6 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs
@@ -1,4 +1,4 @@
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public class BundleResult
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs
similarity index 93%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs
index 4b0efe54ab..b52b9c204f 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs
@@ -1,31 +1,27 @@
using System;
using System.Text;
-using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Minify;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public abstract class BundlerBase : IBundler, ITransientDependency
{
private static string[] _minFileSuffixes = { "min", "prod" };
public ILogger Logger { get; set; }
-
- protected IWebHostEnvironment HostEnvironment { get; }
protected IMinifier Minifier { get; }
protected AbpBundlingOptions BundlingOptions { get; }
protected BundlerBase(
- IWebHostEnvironment hostEnvironment,
IMinifier minifier,
IOptions bundlingOptions)
{
- HostEnvironment = hostEnvironment;
Minifier = minifier;
BundlingOptions = bundlingOptions.Value;
@@ -123,7 +119,7 @@ public abstract class BundlerBase : IBundler, ITransientDependency
protected virtual IFileInfo GetFileInfo(IBundlerContext context, string file)
{
- var fileInfo = HostEnvironment.WebRootFileProvider.GetFileInfo(file);
+ var fileInfo = FindFileInfo(file);
if (!fileInfo.Exists)
{
@@ -150,7 +146,7 @@ public abstract class BundlerBase : IBundler, ITransientDependency
{
foreach (var suffix in _minFileSuffixes)
{
- var fileInfo = HostEnvironment.WebRootFileProvider.GetFileInfo(
+ var fileInfo = FindFileInfo(
$"{file.RemovePostFix($".{FileExtension}")}.{suffix}.{FileExtension}"
);
@@ -163,6 +159,8 @@ public abstract class BundlerBase : IBundler, ITransientDependency
return null;
}
+ protected abstract IFileInfo FindFileInfo(string file);
+
protected virtual string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent)
{
return fileContent;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs
similarity index 91%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs
index 9c9c60a9eb..e39fa90880 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public class BundlerContext : IBundlerContext
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs
similarity index 78%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs
index 9c2f19d4ca..6f80d23a60 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs
@@ -1,6 +1,6 @@
using System;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public interface IBundleCache
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs
similarity index 76%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs
index 067554e102..3c3a50ece1 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public interface IBundleManager
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs
similarity index 58%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs
index 9f396767ee..68e50f4ec7 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs
@@ -1,4 +1,6 @@
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+
+namespace Volo.Abp.AspNetCore.Bundling;
public interface IBundler
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs
similarity index 81%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs
rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs
index d59bc154b5..83d49df220 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+namespace Volo.Abp.AspNetCore.Bundling;
public interface IBundlerContext
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs
new file mode 100644
index 0000000000..2af5f655a7
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs
@@ -0,0 +1,6 @@
+namespace Volo.Abp.AspNetCore.Bundling.Scripts;
+
+public interface IScriptBundler : IBundler
+{
+
+}
diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs
new file mode 100644
index 0000000000..c8fe1cbf2a
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs
@@ -0,0 +1,6 @@
+namespace Volo.Abp.AspNetCore.Bundling.Styles;
+
+public interface IStyleBundler : IBundler
+{
+
+}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs
new file mode 100644
index 0000000000..2ffa74b833
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs
@@ -0,0 +1,106 @@
+using System.Text;
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.Bundling.Styles;
+using Volo.Abp.Modularity;
+using Volo.Abp.Threading;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+[DependsOn(
+ typeof(AbpAspNetCoreComponentsMauiBlazorModule),
+ typeof(AbpAspNetCoreBundlingModule)
+)]
+public class AbpAspNetCoreComponentsMauiBlazorBundlingModule : AbpModule
+{
+ public override void OnApplicationInitialization(ApplicationInitializationContext context)
+ {
+ AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
+ }
+
+ public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
+ {
+ await InitialGlobalAssetsAsync(context);
+ }
+
+ protected virtual async Task InitialGlobalAssetsAsync(ApplicationInitializationContext context)
+ {
+ var bundlingOptions = context.ServiceProvider.GetRequiredService>().Value;
+ var logger = context.ServiceProvider.GetRequiredService>();
+ if (!bundlingOptions.GlobalAssets.Enabled)
+ {
+ return;
+ }
+
+ var bundleManager = context.ServiceProvider.GetRequiredService();
+ var mauiBlazorContentFileProvider = context.ServiceProvider.GetRequiredService();
+ var dynamicFileProvider = context.ServiceProvider.GetRequiredService();
+ if (!bundlingOptions.GlobalAssets.GlobalStyleBundleName.IsNullOrWhiteSpace())
+ {
+ var styleFiles = await bundleManager.GetStyleBundleFilesAsync(bundlingOptions.GlobalAssets.GlobalStyleBundleName);
+ var styles = string.Empty;
+ foreach (var file in styleFiles)
+ {
+ var fileInfo = mauiBlazorContentFileProvider.GetFileInfo(file.FileName);
+ if (!fileInfo.Exists)
+ {
+ logger.LogError($"Could not find the file: {file.FileName}");
+ continue;
+ }
+
+ var fileContent = await fileInfo.ReadAsStringAsync();
+ if (!bundleManager.IsBundlingEnabled())
+ {
+ fileContent = CssRelativePath.Adjust(fileContent,
+ file.FileName,
+ Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"));
+
+ styles += $"/*{file.FileName}*/{Environment.NewLine}{fileContent}{Environment.NewLine}{Environment.NewLine}";
+ }
+ else
+ {
+ styles += $"{fileContent}{Environment.NewLine}{Environment.NewLine}";
+ }
+ }
+
+ dynamicFileProvider.AddOrUpdate(
+ new InMemoryFileInfo("/wwwroot/" + bundlingOptions.GlobalAssets.CssFileName,
+ Encoding.UTF8.GetBytes(styles),
+ bundlingOptions.GlobalAssets.CssFileName));
+ }
+
+ if (!bundlingOptions.GlobalAssets.GlobalScriptBundleName.IsNullOrWhiteSpace())
+ {
+ var scriptFiles = await bundleManager.GetScriptBundleFilesAsync(bundlingOptions.GlobalAssets.GlobalScriptBundleName);
+ var scripts = string.Empty;
+ foreach (var file in scriptFiles)
+ {
+ var fileInfo = mauiBlazorContentFileProvider.GetFileInfo(file.FileName);
+ if (!fileInfo.Exists)
+ {
+ logger.LogError($"Could not find the file: {file.FileName}");
+ continue;
+ }
+
+ var fileContent = await fileInfo.ReadAsStringAsync();
+ if (!bundleManager.IsBundlingEnabled())
+ {
+ scripts += $"{fileContent.EnsureEndsWith(';')}{Environment.NewLine}{Environment.NewLine}";
+ }
+ else
+ {
+ scripts += $"//{file.FileName}{Environment.NewLine}{fileContent.EnsureEndsWith(';')}{Environment.NewLine}{Environment.NewLine}";
+ }
+ }
+
+ dynamicFileProvider.AddOrUpdate(
+ new InMemoryFileInfo("/wwwroot/" + bundlingOptions.GlobalAssets.JavaScriptFileName,
+ Encoding.UTF8.GetBytes(scripts),
+ bundlingOptions.GlobalAssets.JavaScriptFileName));
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs
new file mode 100644
index 0000000000..dce9f6d644
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs
@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Components.WebView.Maui;
+using Microsoft.Extensions.FileProviders;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+public class AbpBlazorWebView : BlazorWebView
+{
+ public override IFileProvider CreateFileProvider(string contentRootDir)
+ {
+ return new CompositeFileProvider(Handler!.GetRequiredService(), base.CreateFileProvider(contentRootDir));
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs
new file mode 100644
index 0000000000..3d8b0ab938
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs
@@ -0,0 +1,125 @@
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Scripts;
+using Volo.Abp.AspNetCore.Bundling.Styles;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+public class BundleManager : BundleManagerBase, ITransientDependency
+{
+ protected IMauiBlazorContentFileProvider MauiBlazorContentFileProvider { get; }
+
+ public BundleManager(
+ IOptions options,
+ IOptions contributorOptions,
+ IScriptBundler scriptBundler,
+ IStyleBundler styleBundler,
+ IServiceProvider serviceProvider,
+ IDynamicFileProvider dynamicFileProvider,
+ IBundleCache bundleCache,
+ IMauiBlazorContentFileProvider mauiBlazorContentFileProvider) : base(
+ options,
+ contributorOptions,
+ scriptBundler,
+ styleBundler,
+ serviceProvider,
+ dynamicFileProvider,
+ bundleCache)
+ {
+ MauiBlazorContentFileProvider = mauiBlazorContentFileProvider;
+ }
+
+ public override bool IsBundlingEnabled()
+ {
+ switch (Options.Mode)
+ {
+ case BundlingMode.None:
+ return false;
+ case BundlingMode.Bundle:
+ case BundlingMode.BundleAndMinify:
+ return true;
+ case BundlingMode.Auto:
+ return !IsDebug();
+ default:
+ throw new AbpException($"Unhandled {nameof(BundlingMode)}: {Options.Mode}");
+ }
+ }
+
+ protected async override Task> GetBundleFilesAsync(List contributors)
+ {
+ var files = await base.GetBundleFilesAsync(contributors);
+
+ foreach (var file in files)
+ {
+ await CopyFileToAppDataDirectoryAsync(file);
+ }
+
+ return files;
+ }
+
+ protected virtual async Task CopyFileToAppDataDirectoryAsync(BundleFile file)
+ {
+ if (file.IsExternalFile)
+ {
+ return;
+ }
+
+ var fileName = Path.Combine("wwwroot", file.FileName);
+ if(MauiBlazorContentFileProvider.GetFileInfo(fileName).Exists)
+ {
+ return;
+ }
+
+ try
+ {
+ await using var inputStream = await FileSystem.Current.OpenAppPackageFileAsync(fileName);
+ var targetFile = Path.Combine(FileSystem.Current.AppDataDirectory, fileName);
+ var fileDirectory = Path.GetDirectoryName(targetFile)!;
+ if (!Path.Exists(fileDirectory))
+ {
+ Directory.CreateDirectory(fileDirectory);
+ }
+ await using var outputStream = File.Create(targetFile);
+ await inputStream.CopyToAsync(outputStream);
+ }
+ catch (Exception e)
+ {
+ Logger.LogError($"Could not copy the file to the app data directory: {fileName}", e);
+ }
+ }
+
+ protected override bool IsMinficationEnabled()
+ {
+ switch (Options.Mode)
+ {
+ case BundlingMode.None:
+ case BundlingMode.Bundle:
+ return false;
+ case BundlingMode.BundleAndMinify:
+ return true;
+ case BundlingMode.Auto:
+ return !IsDebug();
+ default:
+ throw new AbpException($"Unhandled {nameof(BundlingMode)}: {Options.Mode}");
+ }
+ }
+
+ protected virtual bool IsDebug()
+ {
+ #if DEBUG
+ return true;
+ #else
+ retur false;
+ #endif
+ }
+
+ protected override IFileProvider GetFileProvider()
+ {
+ return MauiBlazorContentFileProvider;
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs
new file mode 100644
index 0000000000..4c7a50a339
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs
@@ -0,0 +1,8 @@
+using Microsoft.Extensions.FileProviders;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+public interface IMauiBlazorContentFileProvider : IFileProvider
+{
+ string ContentRootPath { get; }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs
new file mode 100644
index 0000000000..b02c80435a
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs
@@ -0,0 +1,26 @@
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.Minify;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+public abstract class MauiBlazorBundlerBase : BundlerBase
+{
+ protected IMauiBlazorContentFileProvider MauiBlazorContentFileProvider { get; }
+
+ public MauiBlazorBundlerBase(
+ IMauiBlazorContentFileProvider mauiBlazorContentFileProvider,
+ IMinifier minifier,
+ IOptions bundlingOptions) : base(minifier,
+ bundlingOptions)
+ {
+ MauiBlazorContentFileProvider = mauiBlazorContentFileProvider;
+ }
+
+ protected override IFileInfo FindFileInfo(string file)
+ {
+ return MauiBlazorContentFileProvider.GetFileInfo(file);
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs
new file mode 100644
index 0000000000..a9ee633e6c
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs
@@ -0,0 +1,65 @@
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Primitives;
+using Microsoft.Maui.Controls.PlatformConfiguration;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling;
+
+public class MauiBlazorContentFileProvider : IMauiBlazorContentFileProvider, ISingletonDependency
+{
+ private readonly IVirtualFileProvider _virtualFileProvider;
+ private readonly IFileProvider _fileProvider;
+ private string _rootPath = "/wwwroot";
+
+ public MauiBlazorContentFileProvider(IVirtualFileProvider virtualFileProvider)
+ {
+ _virtualFileProvider = virtualFileProvider;
+ _fileProvider = CreateFileProvider();
+ }
+
+ public string ContentRootPath => FileSystem.Current.AppDataDirectory;
+
+ public IFileInfo GetFileInfo(string subpath)
+ {
+ if (string.IsNullOrEmpty(subpath))
+ {
+ return new NotFoundFileInfo(subpath);
+ }
+
+ var fileInfo = _fileProvider.GetFileInfo(subpath);
+ return fileInfo.Exists ? fileInfo : _fileProvider.GetFileInfo( _rootPath + subpath.EnsureStartsWith('/'));
+ }
+
+ public IDirectoryContents GetDirectoryContents(string subpath)
+ {
+ if (string.IsNullOrEmpty(subpath))
+ {
+ return NotFoundDirectoryContents.Singleton;
+ }
+
+ var directory = _fileProvider.GetDirectoryContents(subpath);
+ return directory.Exists ? directory : _fileProvider.GetDirectoryContents( _rootPath + subpath.EnsureStartsWith('/'));
+ }
+
+ public IChangeToken Watch(string filter)
+ {
+ return new CompositeChangeToken(
+ [
+ _fileProvider.Watch(_rootPath + filter),
+ _fileProvider.Watch(filter)
+ ]
+ );
+ }
+
+ protected virtual IFileProvider CreateFileProvider()
+ {
+ var assetsDirectory = Path.Combine(ContentRootPath, _rootPath.TrimStart('/'));
+ if (!Path.Exists(assetsDirectory))
+ {
+ Directory.CreateDirectory(assetsDirectory);
+ }
+
+ return new CompositeFileProvider(new PhysicalFileProvider(assetsDirectory), _virtualFileProvider);
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs
new file mode 100644
index 0000000000..8e3d36b5da
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs
@@ -0,0 +1,28 @@
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Scripts;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.Minify.Scripts;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.Scripts;
+
+public class ScriptBundler : MauiBlazorBundlerBase, IScriptBundler
+{
+ public override string FileExtension => "js";
+
+ public ScriptBundler(
+ IMauiBlazorContentFileProvider mauiBlazorContentFileProvider,
+ IJavascriptMinifier minifier,
+ IOptions bundlingOptions)
+ : base(
+ mauiBlazorContentFileProvider,
+ minifier,
+ bundlingOptions)
+ {
+ }
+
+ protected override string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent)
+ {
+ return fileContent.EnsureEndsWith(';') + Environment.NewLine;
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs
new file mode 100644
index 0000000000..f617c21761
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs
@@ -0,0 +1,40 @@
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Styles;
+using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.Bundling.Styles;
+using Volo.Abp.Minify.Styles;
+
+namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.Styles;
+
+public class StyleBundler : MauiBlazorBundlerBase, IStyleBundler
+{
+ private readonly IMauiBlazorContentFileProvider _mauiBlazorContentFileProvider;
+ public override string FileExtension => "css";
+
+ public StyleBundler(
+ IMauiBlazorContentFileProvider mauiBlazorContentFileProvider,
+ ICssMinifier minifier,
+ IOptions bundlingOptions)
+ : base(
+ mauiBlazorContentFileProvider,
+ minifier,
+ bundlingOptions)
+ {
+ _mauiBlazorContentFileProvider = mauiBlazorContentFileProvider;
+ }
+
+ public string GetAbsolutePath(string relativePath)
+ {
+ return Path.Combine(_mauiBlazorContentFileProvider.ContentRootPath, "wwwroot", relativePath.RemovePreFix("/")).Replace("file://", "");
+ }
+
+ protected override string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent)
+ {
+ return CssRelativePath.Adjust(
+ fileContent,
+ GetAbsolutePath(filePath),
+ GetAbsolutePath(context.BundleRelativePath)
+ );
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj
new file mode 100644
index 0000000000..6591bd5359
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+ net9.0-android;net9.0-ios;net9.0-maccatalyst
+ $(TargetFrameworks);net9.0-windows10.0.19041.0
+
+
+ true
+ true
+ enable
+ enable
+
+ 15.0
+ 15.0
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs
index 9ba0baff2d..98ca1b54a4 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Bundling;
-using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs
similarity index 93%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs
rename to framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs
index 79a6272e89..dfc706607e 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs
@@ -1,6 +1,6 @@
-using System;
+using System;
using System.Collections.Concurrent;
-using JetBrains.Annotations;
+using System.Diagnostics.CodeAnalysis;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
@@ -27,4 +27,4 @@ public class AbpBundleContributorOptions
_ => new BundleContributorCollection()
);
}
-}
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj
index fd3995f797..aadb26f388 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj
@@ -19,6 +19,7 @@
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs
index 2292c93a53..13b157748b 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs
@@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.Bundling.Styles;
@@ -21,8 +22,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
[DependsOn(
typeof(AbpAspNetCoreMvcUiBootstrapModule),
- typeof(AbpMinifyModule),
- typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule)
+ typeof(AbpAspNetCoreBundlingModule)
)]
public class AbpAspNetCoreMvcUiBundlingModule : AbpModule
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs
index 9ac43585c0..c28c19a716 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs
@@ -9,6 +9,10 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
+using Microsoft.Extensions.FileProviders;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Scripts;
+using Volo.Abp.AspNetCore.Bundling.Styles;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles;
using Volo.Abp.AspNetCore.Mvc.UI.Resources;
@@ -17,162 +21,47 @@ using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
-public class BundleManager : IBundleManager, ITransientDependency
+public class BundleManager : BundleManagerBase, ITransientDependency
{
- public ILogger Logger { get; set; }
-
- protected readonly AbpBundlingOptions Options;
- protected readonly AbpBundleContributorOptions ContributorOptions;
- protected readonly IWebHostEnvironment HostingEnvironment;
- protected readonly IScriptBundler ScriptBundler;
- protected readonly IStyleBundler StyleBundler;
- protected readonly IServiceProvider ServiceProvider;
- protected readonly IDynamicFileProvider DynamicFileProvider;
- protected readonly IBundleCache BundleCache;
- protected readonly IWebRequestResources RequestResources;
-
public BundleManager(
IOptions options,
IOptions contributorOptions,
- IScriptBundler scriptBundler,
+ IScriptBundler scriptBundler,
IStyleBundler styleBundler,
- IWebHostEnvironment hostingEnvironment,
IServiceProvider serviceProvider,
IDynamicFileProvider dynamicFileProvider,
IBundleCache bundleCache,
- IWebRequestResources requestResources)
+ IWebHostEnvironment hostingEnvironment,
+ IWebRequestResources requestResources) : base(
+ options,
+ contributorOptions,
+ scriptBundler,
+ styleBundler,
+ serviceProvider,
+ dynamicFileProvider,
+ bundleCache)
{
- Options = options.Value;
- ContributorOptions = contributorOptions.Value;
HostingEnvironment = hostingEnvironment;
- ScriptBundler = scriptBundler;
- ServiceProvider = serviceProvider;
- DynamicFileProvider = dynamicFileProvider;
- BundleCache = bundleCache;
RequestResources = requestResources;
- StyleBundler = styleBundler;
-
- Logger = NullLogger.Instance;
- }
-
- public virtual async Task> GetStyleBundleFilesAsync(string bundleName)
- {
- return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler);
- }
-
- public virtual async Task> GetScriptBundleFilesAsync(string bundleName)
- {
- return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler);
- }
-
- protected virtual async Task> GetBundleFilesAsync(BundleConfigurationCollection bundles, string bundleName, IBundler bundler)
- {
- var files = new List();
-
- var contributors = GetContributors(bundles, bundleName);
- var bundleFiles = RequestResources.TryAdd(await GetBundleFilesAsync(contributors));
- var dynamicResources = RequestResources.TryAdd(await GetDynamicResourcesAsync(contributors));
-
- if (!IsBundlingEnabled())
- {
- return bundleFiles.Union(dynamicResources).ToImmutableList();
- }
-
- var localBundleFiles = new List();
- foreach (var bundleFile in bundleFiles)
- {
- if (!bundleFile.IsExternalFile)
- {
- localBundleFiles.Add(bundleFile.FileName);
- }
- else
- {
- if (localBundleFiles.Count != 0)
- {
- files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files);
- localBundleFiles.Clear();
- }
-
- files.Add(bundleFile);
- }
- }
-
- if (localBundleFiles.Count != 0)
- {
- files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files);
- }
-
- return files.Union(dynamicResources).ToImmutableList();
}
- private BundleCacheItem AddToBundleCache(string bundleName, IBundler bundler, List bundleFiles)
- {
- var bundleRelativePath =
- Options.BundleFolderName.EnsureEndsWith('/') +
- bundleName + "." + bundleFiles.JoinAsString("|").ToMd5() + "." + bundler.FileExtension;
-
- return BundleCache.GetOrAdd(bundleRelativePath, () =>
- {
- var cacheValue = new BundleCacheItem(
- new List
- {
- new BundleFile("/" + bundleRelativePath)
- }
- );
-
- WatchChanges(cacheValue, bundleFiles, bundleRelativePath);
+ protected IWebHostEnvironment HostingEnvironment { get; }
- var bundleResult = bundler.Bundle(
- new BundlerContext(
- bundleRelativePath,
- bundleFiles,
- IsMinficationEnabled()
- )
- );
+ protected IWebRequestResources RequestResources { get; }
- SaveBundleResult(bundleRelativePath, bundleResult);
- return cacheValue;
- });
- }
- private void WatchChanges(BundleCacheItem cacheValue, List files, string bundleRelativePath)
+ protected async override Task> GetBundleFilesAsync(List contributors)
{
- lock (cacheValue.WatchDisposeHandles)
- {
- foreach (var file in files)
- {
- var watchDisposeHandle = HostingEnvironment.WebRootFileProvider.Watch(file).RegisterChangeCallback(_ =>
- {
- lock (cacheValue.WatchDisposeHandles)
- {
- cacheValue.WatchDisposeHandles.ForEach(h => h.Dispose());
- cacheValue.WatchDisposeHandles.Clear();
- }
-
- BundleCache.Remove(bundleRelativePath);
- DynamicFileProvider.Delete("/wwwroot/" + bundleRelativePath); //TODO: get rid of wwwroot!
- }, null);
-
- cacheValue.WatchDisposeHandles.Add(watchDisposeHandle);
- }
- }
+ return RequestResources.TryAdd(await base.GetBundleFilesAsync(contributors));
}
- protected virtual void SaveBundleResult(string bundleRelativePath, BundleResult bundleResult)
+ protected async override Task> GetDynamicResourcesAsync(List contributors)
{
- var fileName = bundleRelativePath.Substring(bundleRelativePath.IndexOf('/') + 1);
-
- DynamicFileProvider.AddOrUpdate(
- new InMemoryFileInfo(
- "/wwwroot/" + bundleRelativePath, //TODO: get rid of wwwroot!
- Encoding.UTF8.GetBytes(bundleResult.Content),
- fileName
- )
- );
+ return RequestResources.TryAdd(await base.GetDynamicResourcesAsync(contributors));
}
- public virtual bool IsBundlingEnabled()
+ public override bool IsBundlingEnabled()
{
switch (Options.Mode)
{
@@ -188,7 +77,7 @@ public class BundleManager : IBundleManager, ITransientDependency
}
}
- protected virtual bool IsMinficationEnabled()
+ protected override bool IsMinficationEnabled()
{
switch (Options.Mode)
{
@@ -204,78 +93,8 @@ public class BundleManager : IBundleManager, ITransientDependency
}
}
- protected async Task> GetBundleFilesAsync(List contributors)
- {
- var context = CreateBundleConfigurationContext();
-
- foreach (var contributor in contributors)
- {
- await contributor.PreConfigureBundleAsync(context);
- }
-
- foreach (var contributor in contributors)
- {
- await contributor.ConfigureBundleAsync(context);
- }
-
- foreach (var contributor in contributors)
- {
- await contributor.PostConfigureBundleAsync(context);
- }
-
- return context.Files;
- }
-
- protected virtual async Task> GetDynamicResourcesAsync(List contributors)
- {
- var context = CreateBundleConfigurationContext();
-
- foreach (var contributor in contributors)
- {
- await contributor.ConfigureDynamicResourcesAsync(context);
- }
-
- return context.Files;
- }
-
- protected virtual BundleConfigurationContext CreateBundleConfigurationContext()
- {
- return new BundleConfigurationContext(ServiceProvider, HostingEnvironment.WebRootFileProvider, Options.Parameters);
- }
-
- protected virtual List GetContributors(BundleConfigurationCollection bundles, string bundleName)
- {
- var contributors = new List();
-
- AddContributorsWithBaseBundles(contributors, bundles, bundleName);
-
- for (var i = 0; i < contributors.Count; ++i)
- {
- var extensions = ContributorOptions.Extensions(contributors[i].GetType()).GetAll();
- if (extensions.Count > 0)
- {
- contributors.InsertRange(i + 1, extensions);
- i += extensions.Count;
- }
- }
-
- return contributors;
- }
-
- protected virtual void AddContributorsWithBaseBundles(List contributors, BundleConfigurationCollection bundles, string bundleName)
+ protected override IFileProvider GetFileProvider()
{
- var bundleConfiguration = bundles.Get(bundleName);
-
- foreach (var baseBundleName in bundleConfiguration.BaseBundles)
- {
- AddContributorsWithBaseBundles(contributors, bundles, baseBundleName); //Recursive call
- }
-
- var selfContributors = bundleConfiguration.Contributors.GetAll();
-
- if (selfContributors.Any())
- {
- contributors.AddRange(selfContributors);
- }
+ return HostingEnvironment.WebRootFileProvider;
}
-}
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs
new file mode 100644
index 0000000000..87ba769f75
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs
@@ -0,0 +1,25 @@
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.Minify;
+
+namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+
+public abstract class MvcUiBundlerBase : BundlerBase
+{
+ protected IWebHostEnvironment WebHostingEnvironment { get; }
+
+ protected MvcUiBundlerBase(
+ IWebHostEnvironment webHostingEnvironment,
+ IMinifier minifier,
+ IOptions bundlingOptions) : base(minifier, bundlingOptions)
+ {
+ WebHostingEnvironment = webHostingEnvironment;
+ }
+
+ protected override IFileInfo FindFileInfo(string file)
+ {
+ return WebHostingEnvironment.WebRootFileProvider.GetFileInfo(file);
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs
deleted file mode 100644
index a0204fdb87..0000000000
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts;
-
-public interface IScriptBundler : IBundler
-{
-
-}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs
index 7e3360e4c8..8f48ad31e8 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs
@@ -1,20 +1,22 @@
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Scripts;
using Volo.Abp.Minify.Scripts;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts;
-public class ScriptBundler : BundlerBase, IScriptBundler
+public class ScriptBundler : MvcUiBundlerBase, IScriptBundler
{
public override string FileExtension => "js";
public ScriptBundler(
- IWebHostEnvironment hostEnvironment,
+ IWebHostEnvironment hostingEnvironment,
IJavascriptMinifier minifier,
IOptions bundlingOptions)
: base(
- hostEnvironment,
+ hostingEnvironment,
minifier,
bundlingOptions)
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs
deleted file mode 100644
index 1550730d38..0000000000
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles;
-
-public interface IStyleBundler : IBundler
-{
-
-}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs
index b20e9af7ee..9d6277fa8e 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs
@@ -2,27 +2,28 @@ using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Options;
-using Volo.Abp.AspNetCore.VirtualFileSystem;
+using Volo.Abp.AspNetCore.Bundling;
+using Volo.Abp.AspNetCore.Bundling.Styles;
using Volo.Abp.Bundling.Styles;
using Volo.Abp.Minify.Styles;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles;
-public class StyleBundler : BundlerBase, IStyleBundler
+public class StyleBundler : MvcUiBundlerBase, IStyleBundler
{
private readonly IWebHostEnvironment _hostingEnvironment;
public override string FileExtension => "css";
public StyleBundler(
- IWebHostEnvironment hostEnvironment,
+ IWebHostEnvironment hostingEnvironment,
ICssMinifier minifier,
IOptions bundlingOptions)
: base(
- hostEnvironment,
+ hostingEnvironment,
minifier,
bundlingOptions)
{
- _hostingEnvironment = hostEnvironment;
+ _hostingEnvironment = hostingEnvironment;
}
public string GetAbsolutePath(string relativePath)
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs
index 7939cb7912..b83d090f11 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs
@@ -10,6 +10,7 @@ using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs
index c8486ebadd..c4701aa7d5 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs
index bcfd7d95e2..1ed3a76fe1 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
+using Volo.Abp.AspNetCore.Bundling;
using Volo.Abp.AspNetCore.Security;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers;
diff --git a/nupkg/common.ps1 b/nupkg/common.ps1
index 4233ce7b59..afaa62a32f 100644
--- a/nupkg/common.ps1
+++ b/nupkg/common.ps1
@@ -99,6 +99,7 @@ $projects = (
"framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect",
"framework/src/Volo.Abp.AspNetCore.Abstractions",
"framework/src/Volo.Abp.AspNetCore",
+ "framework/src/Volo.Abp.AspNetCore.Bundling",
"framework/src/Volo.Abp.AspNetCore.Mvc.Dapr",
"framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus",
"framework/src/Volo.Abp.AspNetCore.Components",
@@ -111,6 +112,7 @@ $projects = (
"framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling",
"framework/src/Volo.Abp.AspNetCore.Components.Server",
"framework/src/Volo.Abp.AspNetCore.Components.Server.Theming",
+ "framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling",
"framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling",
"framework/src/Volo.Abp.AspNetCore.MultiTenancy",