Skip to content

Commit

Permalink
Fixed missing CSS on published site = adding bundling.
Browse files Browse the repository at this point in the history
Justification:
When published (under Release configuration) in layout there is just app.min.css. We can either add also other minified CSS there (components, headers,...) or add one bundled and minified 8KB css.
  • Loading branch information
jvilimek committed May 27, 2019
1 parent 48c98bc commit 451f20b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/app.min.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions src/Web/Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<ItemGroup>
<PackageReference Include="Ardalis.ListStartupServices" Version="1.1.3" />
<PackageReference Include="BuildBundlerMinifier" Version="2.9.406" Condition="'$(Configuration)'=='Release'" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
Expand Down
27 changes: 27 additions & 0 deletions src/Web/bundleconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"wwwroot/css/app.css",
"wwwroot/css/app.component.css",
"wwwroot/css/shared/components/header/header.css",
"wwwroot/css/shared/components/identity/identity.css",
"wwwroot/css/shared/components/pager/pager.css",
"wwwroot/css/basket/basket.component.css",
"wwwroot/css/basket/basket-status/basket-status.component.css",
"wwwroot/css/catalog/catalog.component.css",
"wwwroot/css/orders/orders.component.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
"minify": {
"enabled": true,
"renameLocals": true
},
"sourceMap": false
}
]
1 change: 1 addition & 0 deletions src/Web/wwwroot/css/site.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 451f20b

Please sign in to comment.