mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 14:14:13 +01:00
playground: minor build fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -45,11 +45,11 @@ const PlaygroundDialogContent = defineAsyncComponent({
|
||||
let props = defineProps<{ viewer: InstanceType<typeof ModelViewerWrapper> | null }>();
|
||||
const emit = defineEmits<{ findModel: [string] }>()
|
||||
|
||||
const sett = ref(null);
|
||||
const sett = ref<any | null>(null);
|
||||
const showPlaygroundDialog = ref(false);
|
||||
(async () => {
|
||||
sett.value = await settings();
|
||||
return showPlaygroundDialog.value = sett.value.code != "";
|
||||
showPlaygroundDialog.value = sett.value.code != "";
|
||||
})();
|
||||
|
||||
let selection: Ref<Array<SelectionInfo>> = ref([]);
|
||||
@@ -169,7 +169,7 @@ window.addEventListener('keydown', (event) => {
|
||||
</v-btn>
|
||||
</template>
|
||||
<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>
|
||||
</v-dialog>
|
||||
<v-btn icon @click="downloadSceneGlb">
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user