-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathvite.config.ts
51 lines (49 loc) · 1.29 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
/* eslint-disable import/no-extraneous-dependencies */
import { reactRouter } from '@react-router/dev/vite';
import { visualizer } from 'rollup-plugin-visualizer';
import type { PluginOption } from 'vite';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import type { VitePWAOptions } from 'vite-plugin-pwa';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
const pwaOptions: Partial<VitePWAOptions> = {
registerType: 'autoUpdate',
manifest: {
short_name: 'vite-react-chakra-starter',
name: 'Vite React App Template',
lang: 'en',
start_url: '/',
background_color: '#FFFFFF',
theme_color: '#FFFFFF',
dir: 'ltr',
display: 'standalone',
prefer_related_applications: false,
icons: [
{
src: '/assets/favicon.svg',
purpose: 'any',
sizes: '48x48 72x72 96x96 128x128 256x256',
},
],
},
};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
reactRouter(),
checker({
typescript: true,
biome: true,
}),
tsconfigPaths(),
visualizer({ template: 'sunburst' }) as unknown as PluginOption,
VitePWA(pwaOptions),
],
server: {
open: true,
},
ssr: {
noExternal: ['react-helmet-async'], // temporary
},
});