Skip to content

Commit 6d11505

Browse files
committed
Update react-vite-app to mt version
1 parent f0fda4c commit 6d11505

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

apps/react-vite-app/src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function App() {
99
const messageRef = useRef(null);
1010

1111
const load = async () => {
12-
const baseURL = "https://unpkg.com/@ffmpeg/[email protected].1/dist/esm";
12+
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.2/dist/esm";
1313
const ffmpeg = ffmpegRef.current;
1414
ffmpeg.on("log", ({ message }) => {
1515
messageRef.current.innerHTML = message;
@@ -22,6 +22,10 @@ function App() {
2222
`${baseURL}/ffmpeg-core.wasm`,
2323
"application/wasm"
2424
),
25+
workerURL: await toBlobURL(
26+
`${baseURL}/ffmpeg-core.worker.js`,
27+
"text/javascript"
28+
),
2529
});
2630
setLoaded(true);
2731
};

apps/react-vite-app/vite.config.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7-
})
7+
server: {
8+
headers: {
9+
"Cross-Origin-Opener-Policy": "same-origin",
10+
"Cross-Origin-Embedder-Policy": "require-corp",
11+
},
12+
},
13+
});

0 commit comments

Comments
 (0)