staging-tester / ocean-landing-serve / src/ lib/ sailfork.ts

import { createApi, createSyncClient } from '@sailfork/client';
import { createHighlighter } from '@sailfork/client/highlight';
import workerUrl from '../../node_modules/@sailfork/client/dist/highlight-worker.js?worker&url';

export const api = createApi({ base: '' });
export const sync = createSyncClient({ url: '/api/sync' });
// The package's own `new URL('./highlight-worker.js', import.meta.url)` is inlined as a data: URL in a production build, which breaks the worker's imports.
export const highlighter = createHighlighter({ workerUrl });