Files
Ivan 0b0a39ea86 Refactor Docker setup and frontend structure
- Updated Dockerfile to copy frontend files to meshchatx/public directory.
- Modified .dockerignore to include meshchatx/public.
- Added a new script to prepare the frontend directory.
- Adjusted Vite configuration to output to the new public directory.
- Updated GitHub Actions workflow to reflect changes in build process and artifact handling.
2025-11-30 23:34:45 -06:00

81 lines
3.0 KiB
JavaScript

import path from "path";
import vue from '@vitejs/plugin-vue';
import vuetify from 'vite-plugin-vuetify';
export default {
plugins: [
vue(),
vuetify(),
],
// vite app is loaded from /meshchatx/src/frontend
root: path.join(__dirname, "meshchatx", "src", "frontend"),
build: {
// we want to compile vite app to meshchatx/public which is bundled and served by the python executable
outDir: path.join(__dirname, "meshchatx", "public"),
emptyOutDir: true,
rollupOptions: {
input: {
// we want to use /meshchatx/src/frontend/index.html as the entrypoint for this vite app
app: path.join(__dirname, "meshchatx", "src", "frontend", "index.html"),
// we want to use /meshchatx/src/frontend/call.html as the entrypoint for the phone call app
call: path.join(__dirname, "meshchatx", "src", "frontend", "call.html"),
},
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('vuetify')) {
return 'vendor-vuetify';
}
if (id.includes('vis-network') || id.includes('vis-data')) {
return 'vendor-vis';
}
if (id.includes('vue-router')) {
return 'vendor-vue-router';
}
if (id.includes('vue')) {
return 'vendor-vue';
}
if (id.includes('protobufjs') || id.includes('@protobufjs')) {
return 'vendor-protobuf';
}
if (id.includes('moment')) {
return 'vendor-moment';
}
if (id.includes('axios')) {
return 'vendor-axios';
}
if (id.includes('@mdi/js')) {
return 'vendor-mdi';
}
if (id.includes('compressorjs')) {
return 'vendor-compressor';
}
if (id.includes('click-outside-vue3')) {
return 'vendor-click-outside';
}
if (id.includes('mitt')) {
return 'vendor-mitt';
}
if (id.includes('micron-parser')) {
return 'vendor-micron';
}
if (id.includes('electron-prompt')) {
return 'vendor-electron-prompt';
}
return 'vendor-other';
}
},
},
},
},
}