-
-
Notifications
You must be signed in to change notification settings - Fork 364
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (64 loc) · 1.73 KB
/
vite.config.ts
File metadata and controls
65 lines (64 loc) · 1.73 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [
react({
babel: {
plugins: [['babel-plugin-react-compiler', { target: '19' }]],
},
}),
],
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, 'apps', 'client', 'src'),
'@xplorer/sdk': path.resolve(import.meta.dirname, 'packages', 'sdk', 'src', 'index.ts'),
'@xplorer/extension-sdk': path.resolve(
import.meta.dirname,
'packages',
'extension-sdk',
'src',
'index.ts',
),
},
},
root: path.resolve(import.meta.dirname, 'apps', 'client'),
build: {
outDir: path.resolve(import.meta.dirname, 'apps/client/dist'),
emptyOutDir: true,
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name?.includes('pdf.worker')) {
return 'assets/pdf.worker.[hash][extname]';
}
return 'assets/[name].[hash][extname]';
},
},
},
},
server: {
host: '127.0.0.1',
port: 5174,
strictPort: true,
watch: {
ignored: ['**/packages/extensions/**'],
},
},
// Copy PDF worker to public directory
assetsInclude: ['**/*.wasm'],
// Tauri expects a fixed port, fail if that port is not available
clearScreen: false,
// Env variables starting with VITE_ will be exposed to the client
envPrefix: ['VITE_', 'TAURI_'],
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/__tests__/setup.ts'],
include: ['src/__tests__/**/*.{test,spec}.{ts,tsx}'],
define: {
'import.meta.env.TAURI_FAMILY': '"test"',
'window.__TAURI__': 'undefined',
},
},
});