Comments (5)
Thanks for the suggestion. At this point, there is no sample on how to do that, but if StaticWebAsset
is supported in the default Web SDK, then it should not be a big deal to add.
If you be added in the publish targets:
or after the build dist target:
from uno.wasm.bootstrap.
<Project>
<Target Name="CopyingDistToAspNetWwwRoot" AfterTargets="BuildDist">
<ItemGroup>
<DistFiles Include="$(OutputPath)dist\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(DistFiles)"
DestinationFolder="..\..\MyApp.WebApp\wwwroot\wasm\%(RecursiveDir)" SkipUnchangedFiles="true"/>
</Target>
</Project>
from uno.wasm.bootstrap.
Hello.
Did you manage to do it? Any sample to share?
Right now I think that in my CI I'll copy the wasm dist folder to the wwwroot of the aspnetcore.
from uno.wasm.bootstrap.
-
You may just set
WasmShellDistPath
to..\..\MyApp.WebApp\wwwroot\wasm
to achieve the same effect (unless you need to save a copy inside$(OutputPath)dist
). -
You probably should change
WebRootPath
to\wwwroot\wasm
in your ASP.NET Core hosting configuration or pass this path toUseStaticFiles()
/UseSpaStaticFiles()
to correctly servehttp[s]:\\host:[port]\wasm\*
requests.
from uno.wasm.bootstrap.
Alternatively, you can put Uno wasm app directly in wwwroot folder. Here's what it might looks like in a Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
ENV ASPNETCORE_URLS=https://+:443;http://+:80
EXPOSE 443 80
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
COPY . /src
RUN dotnet build "/src/Server/Host/Host.csproj" -c Release -o /app/build
RUN dotnet build "/src/Client/Wasm/Wasm.csproj" -c Release -p:WasmShellDistPath=/app/build/wwwroot
FROM build AS publish
RUN dotnet publish "/src/Server/Host/Host.csproj" -c Release -r linux-x64 -o /app/publish --self-contained=false
RUN dotnet publish "/src/Client/Wasm/Wasm.csproj" -c Release -r browser-wasm -p:WasmShellDistPath=/app/publish/wwwroot --self-contained=false
RUN find /app/publish -type f -name '*.pdb' -delete
FROM base AS final
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Server.Host.dll"]
P.S. I'm using .NET 5.0 in my project for now. I haven't tried 6.0 yet, so things might be different there.
from uno.wasm.bootstrap.
Related Issues (20)
- Randomly received targets error
- Embedded.js does not find mono-config.js HOT 7
- [WASM] Include `<meta>` tags for sharing by default HOT 1
- When loading fails on mobile, there is no way to know why HOT 1
- [Perf] packager should not use powershell to copy files
- Add support for WasmFS HOT 1
- Loading the app does not periodically yield to allow rendering HOT 1
- Include Single Quotes in EscapeJS? HOT 1
- System.ApplicationException: Unable to move PACKAGE_DIST - Access to the path is denied HOT 4
- [WASM] Multithreading with .Net8 doesn't work because Uno.WASM.MetadataUpdate is compiled with .net7? HOT 4
- VS Debugger is slow HOT 1
- `AccelerateBuildsInVisualStudio` breaks boostrapper based builds
- [WASM] Bug in 'service-worker.js' when using the 'WasmPWAManifestFile' option in project file HOT 3
- extension-less support causes in-place compression to be disabled
- Improve support for build acceleration
- Stuck loading app
- Splash image should not be selectable
- Microsoft.CodeSharing.Common.Default.props Not Found in Gitpod HOT 4
- JS Interop only works on main thread when using multiple threads HOT 4
- VS breakpoints don't work with WasmShellEnableThreads HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uno.wasm.bootstrap.