library-picturebook-activity/lesingle-aicreate-client/vite.config.js
En 3c24cc3102 feat: 添加CLAUDE.md项目指导文件及AI创作客户端更新
添加 CLAUDE.md 用于 Claude Code 项目导航,包含架构说明和开发规范。
更新 AI 创作客户端至 V4.0,新增后端对接示例项目。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 12:11:15 +08:00

38 lines
948 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// HTTPS: 启动时加 --https 参数,或设环境变量 VITE_HTTPS=true
// 默认 HTTP局域网测试友好无证书问题
const useHttps = process.argv.includes('--https') || process.env.VITE_HTTPS === 'true'
let sslPlugin = []
if (useHttps) {
try {
const basicSsl = (await import('@vitejs/plugin-basic-ssl')).default
sslPlugin = [basicSsl()]
} catch { /* basicSsl not installed, skip */ }
}
export default defineConfig({
plugins: [vue(), ...sslPlugin],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
port: 3001,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/ws': {
target: 'http://localhost:8080',
ws: true
}
}
}
})