mirror of https://github.com/abpframework/abp.git
16 changed files with 184 additions and 32 deletions
@ -0,0 +1,36 @@ |
|||||
|
using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling; |
||||
|
using Volo.Abp.AspNetCore.Components.Web.Theming; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.Server.Theming |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreComponentsServerModule), |
||||
|
typeof(AbpAspNetCoreMvcUiPackagesModule), |
||||
|
typeof(AbpAspNetCoreComponentsWebThemingModule) |
||||
|
)] |
||||
|
public class AbpAspNetCoreComponentsServerThemingModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<AbpBundlingOptions>(options => |
||||
|
{ |
||||
|
options |
||||
|
.StyleBundles |
||||
|
.Add(BlazorStandardBundles.Styles.Global, bundle => |
||||
|
{ |
||||
|
bundle.AddContributors(typeof(BlazorGlobalStyleContributor)); |
||||
|
}); |
||||
|
|
||||
|
options |
||||
|
.ScriptBundles |
||||
|
.Add(BlazorStandardBundles.Scripts.Global, bundle => |
||||
|
{ |
||||
|
bundle.AddContributors(typeof(BlazorGlobalScriptContributor)); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
||||
|
{ |
||||
|
public class BlazorStandardBundles |
||||
|
{ |
||||
|
public static class Styles |
||||
|
{ |
||||
|
public static string Global = "Blazor.Global"; |
||||
|
} |
||||
|
|
||||
|
public static class Scripts |
||||
|
{ |
||||
|
public static string Global = "Blazor.Global"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
||||
|
{ |
||||
|
public class BlazorGlobalScriptContributor : BundleContributor |
||||
|
{ |
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains("/_framework/blazor.server.js"); |
||||
|
context.Files.AddIfNotContains("/_content/Blazorise/blazorise.js"); |
||||
|
context.Files.AddIfNotContains("/_content/Blazorise.Bootstrap/blazorise.bootstrap.js"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FontAwesome; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(BootstrapStyleContributor), |
||||
|
typeof(FontAwesomeStyleContributor) |
||||
|
)] |
||||
|
public class BlazorGlobalStyleContributor : BundleContributor |
||||
|
{ |
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains("/_content/Blazorise/blazorise.css"); |
||||
|
context.Files.AddIfNotContains("/_content/Blazorise.Bootstrap/blazorise.bootstrap.css"); |
||||
|
context.Files.AddIfNotContains("/_content/Blazorise.Snackbar/blazorise.snackbar.css"); |
||||
|
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
|
<ConfigureAwait /> |
||||
|
</Weavers> |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||
|
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
||||
|
<xs:element name="Weavers"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
||||
|
<xs:complexType> |
||||
|
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
||||
@ -0,0 +1,18 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
|
||||
|
<Import Project="..\..\..\configureawait.props" /> |
||||
|
<Import Project="..\..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net5.0</TargetFramework> |
||||
|
<IsPackable>true</IsPackable> |
||||
|
<OutputType>Library</OutputType> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Server\Volo.Abp.AspNetCore.Components.Server.csproj" /> |
||||
|
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" /> |
||||
|
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Packages\Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,4 @@ |
|||||
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
||||
|
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI |
||||
|
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
||||
|
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace MyCompanyName.MyProjectName.Blazor.Server |
||||
|
{ |
||||
|
public class TestStyleBundleContributor |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue