Files
app_03_pregnancy/frontend/vite.config.ts
Karlcarlo fd1aea1687 build(前端): 配置部署子路径并修复html末尾换行
配置vite的base为/app_03/、路由的basename为/app_03,同时修复index.html缺少末尾换行的问题
2026-05-21 17:10:19 +08:00

41 lines
1.0 KiB
TypeScript
Raw 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 path from 'path'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import basicSsl from '@vitejs/plugin-basic-ssl'
export default defineConfig({
base: '/app_03/',
plugins: [
// The React and Tailwind plugins are both required for Make, even if
// Tailwind is not being actively used – do not remove them
react(),
tailwindcss(),
// basicSsl(), // disabled for cloudflare tunnel compatibility
],
resolve: {
alias: {
// Alias @ to the src directory
'@': path.resolve(__dirname, './src'),
},
},
// File types to support raw imports. Never add .css, .tsx, or .ts files to this.
assetsInclude: ['**/*.svg', '**/*.csv'],
server: {
host: '0.0.0.0',
allowedHosts: ['.trycloudflare.com', '.loca.lt'],
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
'/uploads': {
target: 'http://localhost:8000',
changeOrigin: true,
},
},
},
})