From 981ce98c83b552a12681449ff61b9bbc92831ddc Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sat, 15 Nov 2025 20:07:23 +0900 Subject: [PATCH] [ty] fix ty playground initialization and vite optimization issues --- playground/ty/src/Playground.tsx | 2 +- playground/ty/vite.config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playground/ty/src/Playground.tsx b/playground/ty/src/Playground.tsx index 926861836b..442c2801c9 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 4011bb6f8d..9f49f3c85d 100644 --- a/playground/ty/vite.config.ts +++ b/playground/ty/vite.config.ts @@ -15,7 +15,7 @@ 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() { @@ -23,7 +23,7 @@ export function viteStaticCopyPyodide() { return viteStaticCopy({ targets: [ { - src: [join(pyodideDir, "*"), ...PYODIDE_EXCLUDE], + src: [join(pyodideDir, "*").replace(/\\/g, "/"), ...PYODIDE_EXCLUDE], dest: "assets", }, ],