initial commit
Some checks failed
ci / go (push) Has been cancelled
ci / admin-ui (push) Has been cancelled
ci / runtime-sdk (push) Has been cancelled
ci / helm (push) Has been cancelled
ci / openapi (push) Has been cancelled
ci / container (push) Has been cancelled
ci / release-config (push) Has been cancelled
ci / shared styling (push) Has been cancelled
ci / security (push) Has been cancelled
ci / all green (push) Has been cancelled
Some checks failed
ci / go (push) Has been cancelled
ci / admin-ui (push) Has been cancelled
ci / runtime-sdk (push) Has been cancelled
ci / helm (push) Has been cancelled
ci / openapi (push) Has been cancelled
ci / container (push) Has been cancelled
ci / release-config (push) Has been cancelled
ci / shared styling (push) Has been cancelled
ci / security (push) Has been cancelled
ci / all green (push) Has been cancelled
This commit is contained in:
commit
951dd8d26b
175 changed files with 50041 additions and 0 deletions
52
web/vite.config.ts
Normal file
52
web/vite.config.ts
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import tailwindcss from '@tailwindcss/vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
/**
|
||||
* The admin UI is served by the Go binary from web/dist, and in development by
|
||||
* Vite with a proxy to the API. The proxy matters because the admin UI must be
|
||||
* same-origin in production: the session cookie is HttpOnly and SameSite=Lax, so
|
||||
* a cross-origin development setup would not authenticate at all and the problem
|
||||
* would look like a bug rather than a topology difference.
|
||||
*/
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
target: 'es2022',
|
||||
sourcemap: true,
|
||||
// Split the vendor code out so that an application-only deploy does not
|
||||
// invalidate the framework chunk in every user's cache. Rolldown takes a
|
||||
// function rather than the object form esbuild used.
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id: string) {
|
||||
if (!id.includes('node_modules')) return undefined
|
||||
if (/[\\/](react|react-dom|react-router|react-router-dom)[\\/]/.test(id)) {
|
||||
return 'react'
|
||||
}
|
||||
if (id.includes('@tanstack')) return 'query'
|
||||
return undefined
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
proxy: {
|
||||
'/api': { target: 'http://localhost:8081', changeOrigin: true },
|
||||
'/rt': { target: 'http://localhost:8081', changeOrigin: true },
|
||||
'/auth': { target: 'http://localhost:8081', changeOrigin: true },
|
||||
'/healthz': { target: 'http://localhost:8081', changeOrigin: true },
|
||||
'/readyz': { target: 'http://localhost:8081', changeOrigin: true },
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
css: false,
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue