File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ format-js:
2222# Build chromad binary
2323chromad : 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
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments