-
Notifications
You must be signed in to change notification settings - Fork 12
/
vite.config.ts
88 lines (86 loc) · 1.74 KB
/
vite.config.ts
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
85
86
87
88
import { defineConfig } from 'vite';
import { VitePWA, VitePWAOptions } from 'vite-plugin-pwa';
import react from '@vitejs/plugin-react-swc';
import { visualizer } from 'rollup-plugin-visualizer';
import svgr from 'vite-plugin-svgr';
import path from 'path';
const manifestPlugin: Partial<VitePWAOptions> = {
registerType: 'autoUpdate',
includeAssets: ['favicon.ico'],
injectRegister: 'inline',
devOptions: {
enabled: true,
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
manifest: {
name: 'FreeDi App',
short_name: 'FreeDi',
description: 'FreeDi: Fostering collaboration',
theme_color: '#6394ee',
background_color: '#6394ee',
display: 'standalone',
orientation: 'portrait',
icons: [
{
src: 'icons/logo-48px.png',
sizes: '48x48',
type: 'image/png',
},
{
src: 'icons/logo-72px.png',
sizes: '72x72',
type: 'image/png',
},
{
src: 'icons/logo-96px.png',
sizes: '96x96',
type: 'image/png',
},
{
src: 'icons/logo-128px.png',
sizes: '128x128',
type: 'image/png',
},
{
src: 'icons/logo-192px.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'icons/logo-512px.png',
sizes: '512x512',
type: 'image/png',
},
],
start_url: '/',
},
};
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
plugins: [
react(),
VitePWA(manifestPlugin),
mode === 'development' &&
visualizer({ open: true, gzipSize: true, brotliSize: true }),
svgr({ include: '**/*.svg?react' }),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
define: {
'process.env': process.env,
},
css: {
preprocessorOptions: {
scss: {
api: 'modern'
}
}
}
};
});