Skip to content
Permalink
Browse files
ADD smallest publishable static Blazor project
  • Loading branch information
Vivien FABING committed Oct 15, 2019
1 parent 0e6cdec commit 81d915a1a52d039e8a5e40ac38c1bce81a78803e
Showing with 85 additions and 1 deletion.
  1. +11 −0 App.razor
  2. +8 −0 Pages/Index.razor
  3. +16 −0 Program.cs
  4. +4 −1 README.md
  5. +15 −0 SimpleStaticBlazor.csproj
  6. +17 −0 Startup.cs
  7. +14 −0 wwwroot/index.html
@@ -0,0 +1,11 @@
@using Microsoft.AspNetCore.Components.Routing
@using SimpleStaticBlazor

<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" />
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
@@ -0,0 +1,8 @@
@inherits LayoutComponentBase
@page "/"

<div class="main">
<div class="content px-4">
<h1>Hello, world!</h1>
</div>
</div>
@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Blazor.Hosting;

namespace SimpleStaticBlazor
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
BlazorWebAssemblyHost.CreateDefaultBuilder()
.UseBlazorStartup<Startup>();
}
}
@@ -1 +1,4 @@
# SimpleStaticBlazor
# SimpleStaticBlazor
## Publish

`dotnet publish -c release`
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Exe</OutputType>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19465.2" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19465.2" PrivateAssets="all" />
</ItemGroup>

</Project>
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Components.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace SimpleStaticBlazor
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}

public void Configure(IComponentsApplicationBuilder app)
{
app.AddComponent<App>("app");
}
}
}
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>simple-blazor</title>
<base href="/" />
</head>
<body>
<app>Loading...</app>

<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>

0 comments on commit 81d915a

Please sign in to comment.