17 lines
570 B
TypeScript
17 lines
570 B
TypeScript
import { defineConfig } from 'vite'
|
|
import { fileURLToPath } from 'node:url'
|
|
import solid from 'vite-plugin-solid'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// 构建产物直接落到 Go 的 //go:embed 目录,保持单体仓库发布形态。
|
|
// base 设为 /static/ 让 Vite 资源路径命中 Go 的 /static/ 文件服务。
|
|
export default defineConfig({
|
|
plugins: [solid(), tailwindcss()],
|
|
base: '/static/',
|
|
build: {
|
|
outDir: fileURLToPath(new URL('../internal/server/static', import.meta.url)),
|
|
emptyOutDir: true,
|
|
},
|
|
server: { port: 5173 },
|
|
})
|