-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
30 lines (28 loc) · 990 Bytes
/
Copy pathvite.config.ts
File metadata and controls
30 lines (28 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/// <reference types="node" />
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import { viteSingleFile } from 'vite-plugin-singlefile'
// BUILD_TARGET=singlefile produces a fully self-contained index.html (true
// double-click portability: all JS/CSS/fonts inlined, runs from file://).
const singlefile = process.env.BUILD_TARGET === 'singlefile'
export default defineConfig({
// Relative base so the build runs under the Electron app:// protocol and
// when opened directly as a portable file.
base: './',
plugins: [react(), ...(singlefile ? [viteSingleFile()] : [])],
build: {
outDir: 'dist',
emptyOutDir: true,
assetsInlineLimit: singlefile ? 100_000_000 : 4096,
chunkSizeWarningLimit: 4000,
target: 'es2021',
},
server: { port: 5173, strictPort: true },
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./test/setup.ts'],
css: false,
include: ['test/**/*.test.{ts,tsx}'],
},
})