We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91004bd commit 37f47d1Copy full SHA for 37f47d1
src/pages/home/uploads/util.ts
@@ -1,5 +1,6 @@
1
import { UploadFileProps } from "./types"
2
import type { WorkerMessage } from "./hash-worker"
3
+import HashWorker from "./hash-worker?worker&inline"
4
5
export const traverseFileTree = async (entry: FileSystemEntry) => {
6
const res: File[] = []
@@ -70,9 +71,7 @@ export const calculateHash = async (
70
71
) => {
72
return new Promise<{ md5: string; sha1: string; sha256: string }>(
73
(resolve, reject) => {
- const worker = new Worker(new URL("./hash-worker.ts", import.meta.url), {
74
- type: "module",
75
- })
+ const worker = new HashWorker()
76
77
const terminate = (fn: () => void) => {
78
worker.terminate()
0 commit comments