fix: main branch

This commit is contained in:
2024-03-07 13:42:29 +00:00
parent 782feedae4
commit dbf2346176
6 changed files with 24 additions and 26 deletions

View File

@ -119,7 +119,7 @@
"tailwindcss": "^3.3.3",
"tinybench": "^2.5.1",
"typescript": "^5.2.2",
"vite": "^5.0.12",
"vite": "^5.1.5",
"vite-plugin-pwa": "^0.17.0",
"vite-plugin-version-mark": "^0.0.10",
"vitest": "^0.34.6"

View File

@ -1,14 +1,16 @@
import { RelayMetricCache, UserRelaysCache } from "@snort/system";
import { SnortSystemDb } from "@snort/system-web";
import { WorkerRelayInterface } from "@snort/worker-relay";
import WorkerRelayPath from "@snort/worker-relay/dist/worker?worker&url";
import WorkerVite from "@snort/worker-relay/src/worker?worker";
import { EventCacheWorker } from "./EventCacheWorker";
import { GiftWrapCache } from "./GiftWrapCache";
import { ProfileCacheRelayWorker } from "./ProfileWorkerCache";
import { UserFollowsWorker } from "./UserFollowsWorker";
export const Relay = new WorkerRelayInterface(WorkerRelayPath);
export const Relay = new WorkerRelayInterface(
import.meta.env.DEV ? new URL("@snort/worker-relay/dist/esm/worker.mjs", import.meta.url) : new WorkerVite()
);
export async function initRelayWorker() {
try {
await Relay.init("relay.db");

View File

@ -55,19 +55,11 @@ export default defineConfig({
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
optimizeDeps: {
exclude: ["@sqlite.org/sqlite-wasm"],
},
define: {
CONFIG: JSON.stringify(appConfig),
global: {}, // needed for custom-event lib
},
worker: {
format: "es",
rollupOptions: {
output: {
format: "module"
}
}
format: "es"
},
});