Skip to content

Commit 981ce98

Browse files
committed
[ty] fix ty playground initialization and vite optimization issues
1 parent 698231a commit 981ce98

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

playground/ty/src/Playground.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export interface InitializedPlayground {
501501

502502
// Run once during startup. Initializes monaco, loads the wasm file, and restores the previous editor state.
503503
async function startPlayground(): Promise<InitializedPlayground> {
504-
const ty = await import("../ty_wasm");
504+
const ty = await import("ty_wasm");
505505
await ty.default();
506506
const version = ty.version();
507507
const monaco = await loader.init();

playground/ty/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const PYODIDE_EXCLUDE = [
1515
// https://vitejs.dev/config/
1616
export default defineConfig({
1717
plugins: [react(), tailwindcss(), viteStaticCopyPyodide()],
18-
optimizeDeps: { exclude: ["pyodide"] },
18+
optimizeDeps: { exclude: ["pyodide", "ty_wasm"] },
1919
});
2020

2121
export function viteStaticCopyPyodide() {
2222
const pyodideDir = dirname(fileURLToPath(import.meta.resolve("pyodide")));
2323
return viteStaticCopy({
2424
targets: [
2525
{
26-
src: [join(pyodideDir, "*"), ...PYODIDE_EXCLUDE],
26+
src: [join(pyodideDir, "*").replace(/\\/g, "/"), ...PYODIDE_EXCLUDE],
2727
dest: "assets",
2828
},
2929
],

0 commit comments

Comments
 (0)