From ab322d4dedad7f608d143182762fd754aa990700 Mon Sep 17 00:00:00 2001 From: ChiaraBm Date: Tue, 10 Dec 2024 22:31:28 +0100 Subject: [PATCH] Updated css loading to use the new bundler --- MoonlightServers.ApiServer/Properties/launchSettings.json | 1 - MoonlightServers.ApiServer/Startup/PluginStartup.cs | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MoonlightServers.ApiServer/Properties/launchSettings.json b/MoonlightServers.ApiServer/Properties/launchSettings.json index cb3b758..ed55a69 100644 --- a/MoonlightServers.ApiServer/Properties/launchSettings.json +++ b/MoonlightServers.ApiServer/Properties/launchSettings.json @@ -7,7 +7,6 @@ "launchBrowser": false, "launchUrl": "swagger", "applicationUrl": "http://localhost:5269", - "commandLineArgs": "--frontend-asset /css/MoonlightServers.min.css", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "MOONLIGHT_APP_PUBLICURL": "http://localhost:5269" diff --git a/MoonlightServers.ApiServer/Startup/PluginStartup.cs b/MoonlightServers.ApiServer/Startup/PluginStartup.cs index 09e1a4b..c08da29 100644 --- a/MoonlightServers.ApiServer/Startup/PluginStartup.cs +++ b/MoonlightServers.ApiServer/Startup/PluginStartup.cs @@ -1,21 +1,26 @@ using MoonCore.Extensions; using Moonlight.ApiServer.Interfaces.Startup; +using Moonlight.ApiServer.Services; namespace MoonlightServers.ApiServer.Startup; public class PluginStartup : IAppStartup { private readonly ILogger Logger; + private readonly BundleService BundleService; - public PluginStartup(ILogger logger) + public PluginStartup(ILogger logger, BundleService bundleService) { Logger = logger; + BundleService = bundleService; } public Task BuildApp(IHostApplicationBuilder builder) { // Scan the current plugin assembly for di services builder.Services.AutoAddServices(); + + BundleService.BundleCss("css/MoonlightServers.min.css"); return Task.CompletedTask; }