Compare commits
3 Commits
4dd54a4f8b
...
cba2a126ae
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | cba2a126ae | |
Derrick Hammer | 6f5e0765d6 | |
Derrick Hammer | 6cc15997f8 |
4
build.js
4
build.js
|
@ -3,12 +3,12 @@ import esbuild from "esbuild";
|
|||
esbuild.buildSync({
|
||||
entryPoints: ["src/index.ts"],
|
||||
outfile: "dist/index.js",
|
||||
format: "esm",
|
||||
format: "iife",
|
||||
bundle: true,
|
||||
legalComments: "external",
|
||||
// minify: true
|
||||
define: {
|
||||
global: "self",
|
||||
},
|
||||
inject:['timers.js']
|
||||
inject: ["timers.js", "polyfill.js"],
|
||||
});
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
"@libp2p/utils": "^3.0.6",
|
||||
"@lumeweb/kernel-swarm-client": "git+https://git.lumeweb.com/LumeWeb/kernel-swarm-client.git",
|
||||
"@multiformats/mafmt": "^11.1.2",
|
||||
"@peculiar/webcrypto": "git+https://git.lumeweb.com/LumeWeb/webcrypto.git",
|
||||
"b4a": "^1.6.3",
|
||||
"blockstore-idb": "^1.1.0",
|
||||
"buffer": "^6.0.3",
|
||||
|
@ -72,6 +73,7 @@
|
|||
"@types/streamx": "^2.9.1",
|
||||
"@types/ws": "^8.5.4",
|
||||
"cli-progress": "^3.12.0",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"esbuild": "^0.14.54",
|
||||
"http-browserify": "^1.7.0",
|
||||
"hyperswarm": "^4.4.0",
|
||||
|
@ -98,6 +100,8 @@
|
|||
"timers": "timers-browserify",
|
||||
"path": "path-browserify",
|
||||
"os": "os-browserify",
|
||||
"net": "./src/net.ts"
|
||||
"net": "./src/net.ts",
|
||||
"crypto": "crypto-browserify",
|
||||
"stream": "stream-browserify"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import { Crypto } from "@peculiar/webcrypto";
|
||||
import { Buffer } from "buffer";
|
||||
|
||||
let globalCrypto = self.crypto;
|
||||
if (!globalCrypto.subtle) {
|
||||
let subtleCrypto = new Crypto().subtle;
|
||||
Object.defineProperty(globalCrypto, "subtle", {
|
||||
get() {
|
||||
return subtleCrypto;
|
||||
},
|
||||
});
|
||||
}
|
||||
export { Buffer };
|
Loading…
Reference in New Issue