0.13.1-4 release snapshot

This commit is contained in:
2026-04-13 11:52:07 +00:00
parent 6115090da1
commit ba3732af6b
176 changed files with 103457 additions and 1 deletions
+56
View File
@@ -0,0 +1,56 @@
import { readFileSync } from 'node:fs';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
const appPackage = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
const publicOrigin = (process.env.VITE_PUBLIC_ORIGIN || '').trim();
const parsedAllowedHosts = (process.env.VITE_ALLOWED_HOSTS || '')
.split(',')
.map((item) => item.trim())
.filter(Boolean);
const allowedHosts = parsedAllowedHosts.length > 0 ? parsedAllowedHosts : true;
let hmr = undefined;
if (publicOrigin) {
const url = new URL(publicOrigin);
const defaultClientPort = url.port
? Number(url.port)
: (url.protocol === 'https:' ? 443 : 80);
hmr = {
protocol: process.env.VITE_HMR_PROTOCOL || (url.protocol === 'https:' ? 'wss' : 'ws'),
host: process.env.VITE_HMR_HOST || url.hostname,
clientPort: Number(process.env.VITE_HMR_CLIENT_PORT || defaultClientPort)
};
}
export default defineConfig({
plugins: [react()],
define: {
__APP_VERSION__: JSON.stringify(appPackage.version)
},
server: {
host: '0.0.0.0',
port: 5173,
strictPort: true,
origin: publicOrigin || undefined,
allowedHosts,
hmr,
proxy: {
'/api': {
target: 'http://127.0.0.1:3001',
changeOrigin: true
},
'/ws': {
target: 'ws://127.0.0.1:3001',
ws: true,
changeOrigin: true
}
}
},
preview: {
host: '0.0.0.0',
port: 5173,
strictPort: true
}
});