Browse Source

Fixed missing CSS on published site = adding bundling.

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.
main
Vilimek, Jan 7 years ago
parent
commit
451f20b515
  1. 2
      src/Web/Views/Shared/_Layout.cshtml
  2. 1
      src/Web/Web.csproj
  3. 27
      src/Web/bundleconfig.json
  4. 1
      src/Web/wwwroot/css/site.min.css

2
src/Web/Views/Shared/_Layout.cshtml

@ -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" <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-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /> 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> </environment>
</head> </head>
<body> <body>

1
src/Web/Web.csproj

@ -14,6 +14,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Ardalis.ListStartupServices" Version="1.1.3" /> <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.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />

27
src/Web/bundleconfig.json

@ -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
src/Web/wwwroot/css/site.min.css

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save