mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 22:24:17 +01:00
playground: minor build fixes
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import vue from '@vitejs/plugin-vue'
|
|||||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import {name, version} from './package.json'
|
import {name, version} from './package.json'
|
||||||
import {execSync} from 'child_process'
|
import {execSync} from 'child_process'
|
||||||
import { viteStaticCopy } from "vite-plugin-static-copy";
|
import {viteStaticCopy} from "vite-plugin-static-copy";
|
||||||
import { dirname, join } from "path";
|
import {dirname, join} from "path";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -22,7 +22,7 @@ export default defineConfig({
|
|||||||
vueJsx(),
|
vueJsx(),
|
||||||
viteStaticCopyPyodide(),
|
viteStaticCopyPyodide(),
|
||||||
],
|
],
|
||||||
optimizeDeps: { exclude: ["pyodide"] },
|
optimizeDeps: {exclude: ["pyodide"]},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
// @ts-ignore
|
// @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: {
|
define: {
|
||||||
__APP_NAME__: JSON.stringify(name),
|
__APP_NAME__: JSON.stringify(name),
|
||||||
__APP_VERSION__: JSON.stringify(version),
|
__APP_VERSION__: JSON.stringify(version),
|
||||||
|
|||||||
Reference in New Issue
Block a user