Skip to content

Commit b4ee5b2

Browse files
committed
Use bundled and minified css only for release builds for easier debugging and hot reload
1 parent 82c7804 commit b4ee5b2

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/CreateNewBlogPostPageTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Threading.Tasks;
1+
using System.Threading.Tasks;
32
using Blazored.Toast.Services;
43
using Bunit;
54
using Bunit.TestDoubles;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace LinkDotNet.Blog.Web.Pages;
2+
3+
public static class DebugHelper
4+
{
5+
#if DEBUG
6+
public const bool IsDebug = true;
7+
#else
8+
public const bool IsDebug = false;
9+
#endif
10+
11+
}

LinkDotNet.Blog.Web/Pages/_Host.cshtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
<meta name="msapplication-TileColor" content="#da532c">
2222
<meta name="theme-color" content="#ffffff">
2323
<link rel="preload" href="css/bootstrap/bootstrap.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="css/bootstrap/bootstrap.min.css"></noscript>
24-
<link href="css/bundle.min.css" rel="stylesheet"/>
24+
@if (DebugHelper.IsDebug)
25+
{
26+
<link href="css/basic.css" rel="stylesheet" />
27+
}
28+
else
29+
{
30+
<link href="css/bundle.min.css" rel="stylesheet"/>
31+
}
2532
<link href="LinkDotNet.Blog.Web.styles.css" rel="stylesheet"/>
2633
<link rel="preload" href="_content/Blazored.Toast/blazored-toast.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="_content/Blazored.Toast/blazored-toast.min.css"></noscript>
2734
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />

0 commit comments

Comments
 (0)