diff --git a/playground/ty/src/Playground.tsx b/playground/ty/src/Playground.tsx index 926861836bfec..442c2801c940d 100644 --- a/playground/ty/src/Playground.tsx +++ b/playground/ty/src/Playground.tsx @@ -501,7 +501,7 @@ export interface InitializedPlayground { // Run once during startup. Initializes monaco, loads the wasm file, and restores the previous editor state. async function startPlayground(): Promise { - const ty = await import("../ty_wasm"); + const ty = await import("ty_wasm"); await ty.default(); const version = ty.version(); const monaco = await loader.init(); diff --git a/playground/ty/vite.config.ts b/playground/ty/vite.config.ts index 4011bb6f8d63c..b8c69e8c5c341 100644 --- a/playground/ty/vite.config.ts +++ b/playground/ty/vite.config.ts @@ -3,6 +3,7 @@ import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react-swc"; import { dirname, join } from "path"; import { fileURLToPath } from "url"; +import { normalizePath } from "vite"; import { viteStaticCopy } from "vite-plugin-static-copy"; const PYODIDE_EXCLUDE = [ @@ -15,15 +16,17 @@ const PYODIDE_EXCLUDE = [ // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss(), viteStaticCopyPyodide()], - optimizeDeps: { exclude: ["pyodide"] }, + optimizeDeps: { exclude: ["pyodide", "ty_wasm"] }, }); export function viteStaticCopyPyodide() { - const pyodideDir = dirname(fileURLToPath(import.meta.resolve("pyodide"))); + const pyodideDir = normalizePath( + join(dirname(fileURLToPath(import.meta.resolve("pyodide"))), "*"), + ); return viteStaticCopy({ targets: [ { - src: [join(pyodideDir, "*"), ...PYODIDE_EXCLUDE], + src: [pyodideDir, ...PYODIDE_EXCLUDE], dest: "assets", }, ],