From f74118e0f5d8cfb47fda3f44302502241c0a6951 Mon Sep 17 00:00:00 2001 From: notgiven688 Date: Wed, 15 Nov 2023 21:46:22 +0100 Subject: [PATCH] Update README.md in WebDemo --- other/WebDemo/README.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/other/WebDemo/README.md b/other/WebDemo/README.md index ae736bfd..28708ea4 100644 --- a/other/WebDemo/README.md +++ b/other/WebDemo/README.md @@ -1,26 +1,38 @@ -## .NET WebAssembly Browser app +## Jitter2 in the browser -## Build +**Credits for this 'HowTo': https://github.com/disketteman/DotnetRaylibWasm** -You can build the app from Visual Studio or from the command-line: +## Local setup +Make sure you have the latest version of .NET 7 for example from [here](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), the prototype was built with: ``` -dotnet build -c Debug/Release +dotnet --version +7.0.100 ``` -After building the app, the result is in the `bin/$(Configuration)/net8.0/browser-wasm/AppBundle` directory. +Install the official wasm tooling: -## Run +``` +dotnet workload install wasm-tools +dotnet workload install wasm-experimental +``` + +Install a tool to create ad-hoc http server to serve `application/wasm`: + +``` +dotnet tool install --global dotnet-serve +``` + +## Run it -You can build the app from Visual Studio or the command-line: +`publish` the solution. Don't use `build`. Publishing may take a while. ``` -dotnet run -c Debug/Release +dotnet publish -C Release ``` -Or you can start any static file server from the AppBundle directory: +To serve the files use this command: ``` -dotnet tool install dotnet-serve -dotnet serve -d:bin/$(Configuration)/net8.0/browser-wasm/AppBundle +dotnet serve --mime .wasm=application/wasm --mime .js=text/javascript --mime .json=application/json --directory ./bin/Debug/net7.0/browser-wasm/AppBundle ``` \ No newline at end of file