playground: minor build fixes

This commit is contained in:
Yeicor
2025-07-19 22:02:33 +02:00
parent fc32393635
commit b54453ca06
3 changed files with 9 additions and 8 deletions

View File

@@ -54,8 +54,6 @@ async function setupPyodide() {
await (micropip.install("lib3mf")) await (micropip.install("lib3mf"))
micropip.add_mock_package("py-lib3mf", "2.4.1", modules={"py_lib3mf": '''from lib3mf import *'''}) micropip.add_mock_package("py-lib3mf", "2.4.1", modules={"py_lib3mf": '''from lib3mf import *'''})
await (micropip.install(["build123d"]))`, output); await (micropip.install(["build123d"]))`, output);
output("Preimporting build123d...\n");
await asyncRun(`import build123d`);
if (props.initialCode != "") { if (props.initialCode != "") {
await runCode(); await runCode();
opacity.value = 0.0; // Hide editor after running initial code opacity.value = 0.0; // Hide editor after running initial code

View File

@@ -45,11 +45,11 @@ const PlaygroundDialogContent = defineAsyncComponent({
let props = defineProps<{ viewer: InstanceType<typeof ModelViewerWrapper> | null }>(); let props = defineProps<{ viewer: InstanceType<typeof ModelViewerWrapper> | null }>();
const emit = defineEmits<{ findModel: [string] }>() const emit = defineEmits<{ findModel: [string] }>()
const sett = ref(null); const sett = ref<any | null>(null);
const showPlaygroundDialog = ref(false); const showPlaygroundDialog = ref(false);
(async () => { (async () => {
sett.value = await settings(); sett.value = await settings();
return showPlaygroundDialog.value = sett.value.code != ""; showPlaygroundDialog.value = sett.value.code != "";
})(); })();
let selection: Ref<Array<SelectionInfo>> = ref([]); let selection: Ref<Array<SelectionInfo>> = ref([]);
@@ -169,7 +169,7 @@ window.addEventListener('keydown', (event) => {
</v-btn> </v-btn>
</template> </template>
<template v-slot:default="{ isActive }"> <template v-slot:default="{ isActive }">
<playground-dialog-content v-if="sett != null" :initial-code="sett.code" @close="isActive.value = false"/> <playground-dialog-content v-if="sett != null" :initial-code="sett.value.code" @close="isActive.value = false"/>
</template> </template>
</v-dialog> </v-dialog>
<v-btn icon @click="downloadSceneGlb"> <v-btn icon @click="downloadSceneGlb">

View File

@@ -40,6 +40,9 @@ export default defineConfig({
} }
} }
}, },
worker: {
format: 'es', // Use ES modules for workers (IIFE is not supported with code-splitting)
},
define: { define: {
__APP_NAME__: JSON.stringify(name), __APP_NAME__: JSON.stringify(name),
__APP_VERSION__: JSON.stringify(version), __APP_VERSION__: JSON.stringify(version),