fixing style
This commit is contained in:
parent
e454940dfa
commit
f40485842d
35 changed files with 16000 additions and 286 deletions
|
|
@ -1,24 +1,41 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import {defineConfig, loadEnv, type Plugin} from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
// Build into the repository root; the Dockerfile and `make ui` copy the result
|
||||
// into the Go embed directory (cmd/server/web/dist).
|
||||
build: {
|
||||
outDir: '../dist',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/health': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
function themeContract(origin: string): Plugin {
|
||||
const base = origin.replace(/\/+$/, '')
|
||||
return {
|
||||
name: 'go-bananas-contract',
|
||||
transformIndexHtml(html) {
|
||||
if (!base) return html
|
||||
const tags = [
|
||||
`<link rel="stylesheet" href="${base}/rt/v1/contract.css" data-theme-contract>`,
|
||||
`<script type="module" src="${base}/rt/v1/components.js"></script>`,
|
||||
].join('\n ')
|
||||
return html.replace('</head>', ` ${tags}\n </head>`)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig(({mode}) => {
|
||||
const env = loadEnv(mode, '.', '')
|
||||
const themeOrigin = env.VITE_THEME_BASE_URL || ''
|
||||
return {
|
||||
plugins: [react(), themeContract(themeOrigin)],
|
||||
build: {
|
||||
outDir: '../dist',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/health': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue