mirror of
https://github.com/ApfelTeeSaft/WebMetal.git
synced 2026-08-26 19:43:24 +00:00
31 lines
789 B
TypeScript
31 lines
789 B
TypeScript
/// <reference types="vitest/config" />
|
|
import { readFileSync } from 'node:fs'
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const pkg = JSON.parse(
|
|
readFileSync(new URL('./package.json', import.meta.url), 'utf-8'),
|
|
) as { version: string }
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
// Relative base so the built dist/ works from any static host or subpath
|
|
// (GitHub Pages, nginx subdirectory, plain file server).
|
|
base: './',
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
},
|
|
server: {
|
|
fs: {
|
|
// The bundled example projects live in ../examples at the repo root.
|
|
allow: ['..'],
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'node',
|
|
include: ['src/**/*.test.{ts,tsx}'],
|
|
},
|
|
})
|