-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
50 lines (49 loc) · 1.44 KB
/
vite.config.ts
File metadata and controls
50 lines (49 loc) · 1.44 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
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig(({mode}) => {
const env = loadEnv(mode, '.', '');
return {
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'favicon.svg', 'apple-touch-icon.png', 'masked-icon.svg'],
manifest: {
name: 'MarkdownPDF',
short_name: 'MD2PDF',
description: 'A blazingly fast, browser-native markdown renderer and PDF converter.',
theme_color: '#2563eb',
background_color: '#ffffff',
display: 'standalone',
icons: [
{
src: '/web-app-manifest-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/web-app-manifest-512x512.png',
sizes: '512x512',
type: 'image/png',
}
]
}
})
],
define: {
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
server: {
// HMR is disabled in AI Studio via DISABLE_HMR env var.
// Do not modifyâfile watching is disabled to prevent flickering during agent edits.
hmr: process.env.DISABLE_HMR !== 'true',
},
};
});