Init frontend (#1)

更新静态资源
This commit is contained in:
bingochaos
2025-08-07 18:18:54 +08:00
committed by GitHub
parent 10b28534be
commit 3fddf021be
67 changed files with 11271 additions and 0 deletions

70
vite.config.ts Normal file
View File

@@ -0,0 +1,70 @@
import legacyPlugin from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// import mkcert from 'vite-plugin-mkcert'
import { join } from 'path'
// server of your OpenAvatarChat
const serverIP = '127.0.0.1'
const serverPort = '8282'
// https://vitejs.dev/config/
export default defineConfig({
base: './',
build: {
rollupOptions: {
// input: {
// index: resolve(__dirname, 'index.html'),
// cropImage: resolve(__dirname, 'cropImage.html')
// },
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
},
},
server: {
// host: '0.0.0.0',
// https: true,
// port: 443,
proxy: {
'/download': {
target: `https://${serverIP}:${serverPort}`,
changeOrigin: true,
secure: false,
},
'/openavatarchat': {
target: `https://${serverIP}:${serverPort}`,
changeOrigin: true,
secure: false,
},
'/webrtc/offer': {
target: `https://${serverIP}:${serverPort}`,
changeOrigin: true,
secure: false,
},
'/ws': {
target: `wss://${serverIP}:${serverPort}`,
ws: true,
rewriteWsOrigin: true,
secure: false,
},
},
},
plugins: [
vue(),
// 本地开发如果需要https才能走通接口的话则需要开启mkcert,并且开启mkcert需要sudo权限
// mkcert({
// source: 'coding'
// }),
legacyPlugin({
modernPolyfills: true,
}),
],
resolve: {
alias: {
'@': join(__dirname, 'src'),
},
},
})