Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Oct 16, 2024
1 parent 7fb7afe commit 592fb7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/pyodide/worker/workerApi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { UUID } from "./types";

import { dev } from "$app/environment";
import { cacheSingleton } from "$lib/utils/cache";

const getWorker = cacheSingleton(() => {
const worker = new SharedWorker(new URL("./worker", import.meta.url), { name: "pyodide", type: /* @vite-ignore */ dev ? "module" : "classic" });
const worker = new SharedWorker(new URL("./worker", import.meta.url), { name: "pyodide", type: "module" });
worker.port.addEventListener("message", handleMessage);
worker.port.start();
worker.port.postMessage("hello from main thread");
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ import { defineConfig } from "vite";
export default defineConfig({
plugins: [Unocss(), sveltekit(), dir2json({ include: ["**/*.py", "**/*.j2"] })],
assetsInclude: ["src/python/**/*"],
worker: {
format: "es",
plugins() {
return [sveltekit(), dir2json({ include: ["**/*.py", "**/*.j2"] })];
},
},
});

0 comments on commit 592fb7e

Please sign in to comment.