-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
42 lines (40 loc) · 1.08 KB
/
Copy pathvite.config.ts
File metadata and controls
42 lines (40 loc) · 1.08 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
import path from 'node:path'
import { paraglideVitePlugin } from '@inlang/paraglide-js'
import react from '@vitejs/plugin-react'
import { defineConfig, loadEnv } from 'vite'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// Load env file based on `mode` in the current working directory.
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const _env = loadEnv(mode, process.cwd(), '')
return {
plugins: [
paraglideVitePlugin({
project: './project.inlang',
outdir: './src/paraglide',
}),
react(),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
// Vite automatically exposes environment variables that start with SPOTIFY_
// No need for manual definition as Vite handles it
server: {
open: false,
host: '127.0.0.1',
port: 5173,
},
build: {
outDir: 'dist',
},
// Vitest configuration
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
},
}
})