-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
84 lines (81 loc) · 2.08 KB
/
vite.config.ts
File metadata and controls
84 lines (81 loc) · 2.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { sentryVitePlugin } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react';
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import tailwindcss from '@tailwindcss/vite';
import { visualizer } from 'rollup-plugin-visualizer';
import type { UserConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import type { InlineConfig } from 'vitest';
type ViteConfig = UserConfig & { test: InlineConfig };
const config: ViteConfig = {
plugins: [
react(),
tsconfigPaths(),
tailwindcss(),
visualizer({
filename: 'stats.html',
gzipSize: true,
brotliSize: true,
open: true, // automatically open report
}),
svgr({
// svgr options: https://react-svgr.com/docs/options/
svgrOptions: {
exportType: 'default',
ref: true,
svgo: false,
titleProp: true,
},
include: '**/*.svg',
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'pyotato',
project: 'javascript-react',
disable: true, //disable
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
test: {
globals: true,
environment: 'jsdom',
},
server: {
proxy: {
'/genius/api': {
target: 'https://api.genius.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/genius\/api/, ''),
},
'/api/reccobeats': {
target: 'https://api.reccobeats.com/v1',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/reccobeats/, ''),
},
'/api/lyrics': {
target: 'https://api.lyrics.ovh/v1',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/lyrics/, ''),
},
},
},
build: {
sourcemap: true, // Source map generation must be turned on
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules/@sentry')) {
return 'vendor';
}
},
},
},
},
};
export default defineConfig(config);