Skip to content

Commit

Permalink
tweaks for bun usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfrost committed Mar 23, 2024
1 parent 60e5d8f commit b8ce2e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dist/bun.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { readFile } from "node:fs/promises";
import initYoga from "./index.js";
import { file } from "bun";

import yogaFile from './yoga.wasm';
// .wasm files currently not working in bun with --compile
import yogaFile from './yoga.bun';

const Yoga = await initYoga(
await readFile(yogaFile)
await file(yogaFile).arrayBuffer()
);

export * from "../yoga/javascript/src_js/generated/YGEnums.js";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"scripts": {
"build": "make && rollup -c",
"build": "make && rollup -c && cp ./dist/yoga.wasm ./dist/yoga.bun",
"typecheck": "tsc --noEmit",
"test": "pnpm test:asm && pnpm test:wasm",
"test:asm": "ASM=true vitest run --dir ./test",
Expand Down

0 comments on commit b8ce2e4

Please sign in to comment.