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...)
I had to update the SDK import with crossorigin="anonymous"
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...)
I had to update the SDK import with crossorigin="anonymous"