Skip to content

Commit 33e9742

Browse files
authored
fix module url platform affinity (#135)
1 parent 118d47f commit 33e9742

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

samples/trimming/cs/Trimming.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageReference Include="Bootsharp" Version="*-*"/>
1414
</ItemGroup>
1515

16-
<Target Name="CompressBuild" AfterTargets="BootsharpBuild">
16+
<Target Name="CompressBuild" AfterTargets="BootsharpPack">
1717
<RemoveDir Directories="$(BootsharpPublishDirectory)/bro"/>
1818
<Exec Command="npx gzipper compress bin bro --brotli"
1919
WorkingDirectory="$(BootsharpPublishDirectory)"/>

src/cs/Bootsharp.Publish/Pack/ModulePatcher/InternalPatcher.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ namespace Bootsharp.Publish;
66
[ExcludeFromCodeCoverage(Justification = "How to merge coverage from multiple OS?")]
77
internal sealed class InternalPatcher (string dotnet, string runtime, string native)
88
{
9-
private readonly string url = Environment.OSVersion.Platform == PlatformID.Win32NT
10-
? "\"file://dotnet.native.wasm\""
11-
: "\"file:///dotnet.native.wasm\"";
9+
private const string url =
10+
"""
11+
((typeof window === "object" && "Deno" in window && Deno.build.os === "windows") || (typeof process === "object" && process.platform === "win32")) ? "file://dotnet.native.wasm" : "file:///dotnet.native.wasm"
12+
""";
1213

1314
public void Patch ()
1415
{

src/cs/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.1.2</Version>
3+
<Version>0.1.3</Version>
44
<Authors>Elringus</Authors>
55
<PackageTags>javascript typescript ts js wasm node deno bun interop codegen</PackageTags>
66
<PackageProjectUrl>https://bootsharp.com</PackageProjectUrl>

0 commit comments

Comments
 (0)