chore: perauset customer project
This commit is contained in:
44
apps/app/vite.config.ts
Normal file
44
apps/app/vite.config.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
||||
import { paraglideVitePlugin } from '@inlang/paraglide-js'
|
||||
import path from 'node:path'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
// Compile messages/*.json → src/paraglide so `m`/`mKey` resolve, with HMR on
|
||||
// message edits. Must run first.
|
||||
paraglideVitePlugin({ project: './project.inlang', outdir: './src/paraglide' }),
|
||||
tanstackStart({
|
||||
router: {
|
||||
routesDirectory: path.resolve(import.meta.dirname, 'src/pages'),
|
||||
generatedRouteTree: path.resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
||||
routeFileIgnorePrefix: '-',
|
||||
quoteStyle: 'single',
|
||||
},
|
||||
}),
|
||||
react(),
|
||||
],
|
||||
server: {
|
||||
port: 6001,
|
||||
host: '0.0.0.0',
|
||||
// The standalone Pikku backend serves better-auth under /api/auth but data
|
||||
// RPC + REST routes at the root (/rpc, /users, …). The app calls both under
|
||||
// a single /api base, so strip /api for everything except /api/auth. Keeping
|
||||
// it same-origin (via this proxy) means no CORS and better-auth sees a
|
||||
// consistent Origin. Backend URL overridable for e2e via VITE_BACKEND_URL.
|
||||
proxy: {
|
||||
'/api/auth': process.env.VITE_BACKEND_URL || 'http://localhost:6002',
|
||||
'/api': {
|
||||
target: process.env.VITE_BACKEND_URL || 'http://localhost:6002',
|
||||
rewrite: (p) => p.replace(/^\/api/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
dedupe: ['react', 'react-dom'],
|
||||
alias: {
|
||||
'@': path.resolve(import.meta.dirname, 'src'),
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user