3 ms·
Finally got this working. I was unable to get this to play well with Node or Bun but I did get the <script> approach working. For the CORS with Vite you can ju
by mayyue 3y ago
Finally got this working. I was unable to get this to play well with Node or Bun but I did get the <script> approach working.
For the CORS with Vite you can just set a config like so in vite.config.ts
import { defineConfig } from "vite";
export default defineConfig({
server: {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
},
},
});
I was then able to just use this code example with one caveat (https://github.com/wasmerio/wasmer-js?tab=readme-ov-file#use-with-a-script-tag-without-bundler https://github.com/wasmerio/wasmer-js?tab=readme-ov-file#use...)
I had to update the SDK import with crossorigin="anonymous"