Open minetoblend opened 1 month ago
Since that PR is merged, if it's a matter of using the .NET 9 preview SDK then I can look into doing that (I actually have an in-progress branch doing this already). The desktop native project is already built using both SDKs, though there's still some work to be done.
Anyway, I've compiled it with NET9 locally, can you check if these _framework
files are bundler friendly?
Uh, sorry, this one (trimmed/minified):
Hmm, I took a quick peek on the phone and it looks about the same as before, I'll have to take a closer look at home though
For future reference, my work on this is here: https://github.com/smoogipoo/osu-native/tree/net9-toolset
I'll hold off on it for now because it doesn't really look like dotnet has addressed this issue themselves, from going through their issues/PRs...
The generated
dotnet.js
in the_framework
folder uses fetch calls with static paths to load theblazor.json
file which the contains the required paths for all.wasm
files. This makes it impossible for bundlers to pick up that these files are used, leading to the being excluded when building a project using the library.From what I can tell, the correct bundler-friendly syntax to import assets would either be along the lines of:
or
This is mostly an upstream issue, and looks like asp.net core will switch to rollup for bundling which should eventually fix this, however I think I could try to hack together a little vite plugin that'll rewrite the output a bit to make sure there are bundler-friendly references in to the generated files. The files are unfortunately minified, if there was a way to disable minification (or output source maps) that would make things a lot easier.