-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
69 lines (66 loc) · 2.4 KB
/
vite.config.ts
File metadata and controls
69 lines (66 loc) · 2.4 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
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
workbox: {
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5 MiB
},
manifest: {
name: 'Spotify Gestures',
short_name: 'Gestures',
description: 'Control your Spotify music with hand gestures.',
theme_color: '#1DB954',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
}),
],
define: {
'import.meta.env.VITE_SPOTIFY_CLIENT_ID': JSON.stringify(env.VITE_SPOTIFY_CLIENT_ID || ''),
'import.meta.env.VITE_REDIRECT_URI': JSON.stringify(env.VITE_REDIRECT_URI || ''),
'import.meta.env.VITE_SPOTIFY_AUTH_ENDPOINT': JSON.stringify(env.VITE_SPOTIFY_AUTH_ENDPOINT || 'https://accounts.spotify.com/authorize'),
'import.meta.env.VITE_SPOTIFY_TOKEN_ENDPOINT': JSON.stringify(env.VITE_SPOTIFY_TOKEN_ENDPOINT || 'https://accounts.spotify.com/api/token'),
'import.meta.env.VITE_MUSIXMATCH_API_KEY': JSON.stringify(env.VITE_MUSIXMATCH_API_KEY || ''),
'import.meta.env.VITE_GENIUS_CLIENT_ID': JSON.stringify(env.VITE_GENIUS_CLIENT_ID || ''),
'import.meta.env.VITE_GENIUS_CLIENT_SECRET': JSON.stringify(env.VITE_GENIUS_CLIENT_SECRET || ''),
'import.meta.env.VITE_GENIUS_ACCESS_TOKEN': JSON.stringify(env.VITE_GENIUS_ACCESS_TOKEN || ''),
'import.meta.env.VITE_LASTFM_API_KEY': JSON.stringify(env.VITE_LASTFM_API_KEY || ''),
'import.meta.env.VITE_SOCKET_URL': JSON.stringify(env.VITE_SOCKET_URL || ''),
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 5173,
host: true,
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
secure: false,
},
},
},
};
});