Skip to content

Commit

Permalink
chore: use ?worker&url syntax for getting only worker url
Browse files Browse the repository at this point in the history
  • Loading branch information
logotip4ik committed Nov 9, 2024
1 parent 44cfee0 commit e1c9225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/utils/fuzzy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { ShallowRef } from 'vue';

import proxy from 'unenv/runtime/mock/proxy';

import FuzzyWorkerUrl from '~/workers/fuzzy?worker&url';

export interface FuzzyWorker {
searchWithQuery: (query: string) => Promise<Array<FuzzyItem | CommandItem>>
searchForEmoji: (query: string) => Promise<Array<Emoji>>
Expand Down Expand Up @@ -35,7 +37,7 @@ export async function defineFuzzyWorker() {
const { Worker } = coincident();

// https://vitejs.dev/guide/features.html#web-workers
const worker = new Worker(new URL('../workers/fuzzy.ts', import.meta.url), { type: 'module' });
const worker = new Worker(FuzzyWorkerUrl, { type: 'module' });

// fuzzy worker will be broken till nitro sends headers from route rules in dev mode
// https://github.com/unjs/nitro/issues/2749
Expand Down

0 comments on commit e1c9225

Please sign in to comment.