Skip to content

Commit f3ff116

Browse files
committed
sideload boot bins
1 parent 32cd38f commit f3ff116

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

samples/bench/bootsharp/Boot.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net9.0-browser</TargetFramework>
55
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
6+
<BootsharpEmbedBinaries>false</BootsharpEmbedBinaries>
67
</PropertyGroup>
78

89
<ItemGroup>

samples/bench/bootsharp/init.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import bootsharp, { Export, Import } from "./bin/bootsharp/index.mjs";
22
import { getNumber, getStruct } from "../fixtures.mjs";
3+
import fs from "fs/promises";
34

45
/** @returns {Promise<import("../bench.mjs").Exports>} */
56
export async function init() {
67
Import.getNumber = getNumber;
78
Import.getStruct = getStruct;
89

9-
await bootsharp.boot();
10+
const content = await fs.readFile("./bootsharp/bin/bootsharp/bin/dotnet.native.wasm");
11+
await bootsharp.boot({
12+
root: "./bin",
13+
resources: {
14+
wasm: { name: "dotnet.native.wasm", content },
15+
assemblies: [],
16+
entryAssemblyName: "Boot.dll"
17+
}
18+
});
1019

1120
return { ...Export };
1221
}

0 commit comments

Comments
 (0)