Update react-vite-app to mt version

This commit is contained in:
Jerome Wu 2023-08-09 17:26:43 +08:00
parent f0fda4cd9b
commit 6d115051eb
2 changed files with 14 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function App() {
const messageRef = useRef(null);
const load = async () => {
const baseURL = "https://unpkg.com/@ffmpeg/core@0.12.1/dist/esm";
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.2/dist/esm";
const ffmpeg = ffmpegRef.current;
ffmpeg.on("log", ({ message }) => {
messageRef.current.innerHTML = message;
@ -22,6 +22,10 @@ function App() {
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm"
),
workerURL: await toBlobURL(
`${baseURL}/ffmpeg-core.worker.js`,
"text/javascript"
),
});
setLoaded(true);
};

View File

@ -1,7 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
});