diff --git a/frontend/tools/PlaygroundDialogContent.vue b/frontend/tools/PlaygroundDialogContent.vue index 741359b..ff5a307 100644 --- a/frontend/tools/PlaygroundDialogContent.vue +++ b/frontend/tools/PlaygroundDialogContent.vue @@ -54,8 +54,6 @@ async function setupPyodide() { await (micropip.install("lib3mf")) micropip.add_mock_package("py-lib3mf", "2.4.1", modules={"py_lib3mf": '''from lib3mf import *'''}) await (micropip.install(["build123d"]))`, output); - output("Preimporting build123d...\n"); - await asyncRun(`import build123d`); if (props.initialCode != "") { await runCode(); opacity.value = 0.0; // Hide editor after running initial code diff --git a/frontend/tools/Tools.vue b/frontend/tools/Tools.vue index ed3422d..5837a1b 100644 --- a/frontend/tools/Tools.vue +++ b/frontend/tools/Tools.vue @@ -45,11 +45,11 @@ const PlaygroundDialogContent = defineAsyncComponent({ let props = defineProps<{ viewer: InstanceType | null }>(); const emit = defineEmits<{ findModel: [string] }>() -const sett = ref(null); +const sett = ref(null); const showPlaygroundDialog = ref(false); (async () => { sett.value = await settings(); - return showPlaygroundDialog.value = sett.value.code != ""; + showPlaygroundDialog.value = sett.value.code != ""; })(); let selection: Ref> = ref([]); @@ -169,7 +169,7 @@ window.addEventListener('keydown', (event) => { diff --git a/vite.config.ts b/vite.config.ts index 234f944..c6e6910 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,8 +5,8 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import {name, version} from './package.json' import {execSync} from 'child_process' -import { viteStaticCopy } from "vite-plugin-static-copy"; -import { dirname, join } from "path"; +import {viteStaticCopy} from "vite-plugin-static-copy"; +import {dirname, join} from "path"; // https://vitejs.dev/config/ export default defineConfig({ @@ -22,7 +22,7 @@ export default defineConfig({ vueJsx(), viteStaticCopyPyodide(), ], - optimizeDeps: { exclude: ["pyodide"] }, + optimizeDeps: {exclude: ["pyodide"]}, resolve: { alias: { // @ts-ignore @@ -40,6 +40,9 @@ export default defineConfig({ } } }, + worker: { + format: 'es', // Use ES modules for workers (IIFE is not supported with code-splitting) + }, define: { __APP_NAME__: JSON.stringify(name), __APP_VERSION__: JSON.stringify(version),