Skip to content

Commit 2a78195

Browse files
committed
fix: wasm builds got broken by the last change
1 parent f8a34ec commit 2a78195

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ format-js:
2222
# Build chromad binary
2323
chromad: wasm-exec chroma-wasm
2424
rm -rf build
25-
esbuild --platform=node --bundle cmd/chromad/static/index.js --minify --outfile=cmd/chromad/static/index.min.js
25+
esbuild --platform=browser --format=esm --bundle cmd/chromad/static/index.js --minify --external:./wasm_exec.js --outfile=cmd/chromad/static/index.min.js
2626
esbuild --bundle cmd/chromad/static/index.css --minify --outfile=cmd/chromad/static/index.min.css
2727
cd cmd/chromad && CGOENABLED=0 go build -ldflags="-X 'main.version={{ version }}'" -o ../../build/chromad .
2828

cmd/chromad/static/chroma.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ChromaWASM {
1212
try {
1313
// Create a new Go instance (wasm_exec.js already imported in initChroma)
1414
const go = new Go();
15-
WebAssembly.instantiateStreaming(fetch("./static/chroma.wasm"), go.importObject).then((result) => {
15+
WebAssembly.instantiateStreaming(fetch("/static/chroma.wasm"), go.importObject).then((result) => {
1616
go.run(result.instance);
1717
this.ready = true;
1818
});
@@ -73,7 +73,7 @@ async function initChroma() {
7373
}
7474

7575
try {
76-
await import("./wasm_exec.js");
76+
await import("/static/wasm_exec.js");
7777
return new ChromaWASM();
7878
} catch (error) {
7979
return null;

0 commit comments

Comments
 (0)