Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Commit 3386194

Browse files
committed
chore: add config to correctly build libs
1 parent 1eb6c8d commit 3386194

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
<!DOCTYPE html>
2+
23
<html lang="en">
34
<head>
45
<meta charset="UTF-8" />
56
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
<title>Semaphore benchmarks</title>
9+
<script>
10+
window.global = window;
11+
</script>
12+
<script type="module">
13+
import process from "process";
14+
import EventEmitter from "events";
15+
import {Buffer} from "buffer";
16+
window.Buffer = Buffer;
17+
window.process = process;
18+
window.EventEmitter = EventEmitter;
19+
</script>
820
</head>
921
<body>
1022
<div id="root"></div>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@semaphore-protocol/identity": "^3.1.0",
1414
"@semaphore-protocol/proof": "^3.1.0",
1515
"buffer": "^6.0.3",
16+
"events": "^3.3.0",
1617
"process": "^0.11.10",
1718
"react": "^18.2.0",
1819
"react-dom": "^18.2.0",

vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,13 @@ export default defineConfig({
1717
})
1818
]
1919
}
20+
},
21+
resolve: {
22+
alias: {
23+
process: "process/browser",
24+
stream: "stream-browserify",
25+
zlib: "browserify-zlib",
26+
util: "util"
27+
}
2028
}
2129
})

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,11 @@ escape-string-regexp@^1.0.5:
740740
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
741741
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
742742

743+
events@^3.3.0:
744+
version "3.3.0"
745+
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
746+
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
747+
743748
744749
version "0.0.19"
745750
resolved "https://registry.yarnpkg.com/fastfile/-/fastfile-0.0.19.tgz#02cef9ade123b0a74adb794f4a1abcfa5719fd46"

0 commit comments

Comments
 (0)