-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
88 lines (83 loc) · 2.25 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import viteTsconfigPaths from 'vite-tsconfig-paths'
import { VitePWA } from 'vite-plugin-pwa'
import pluginChecker from 'vite-plugin-checker';
let icon192Url = '/logo192.png'
let icon512Url = '/logo512.png'
export default defineConfig({
// depending on your application, base can also be "/"
// base: '/',
plugins: [
react(),
viteTsconfigPaths(),
pluginChecker({ typescript: true }),
VitePWA({
registerType: 'prompt', // We want to prompt the user to reload, we don't want it to autoupdate
injectRegister: null, // We register it ourselves in index.tsx
devOptions: {
// Set to true if you want to have the PWA code enabled when running
// npm run start (dev. mode)
enabled: false
},
includeAssets: [
icon192Url,
icon512Url,
],
manifest: {
name: 'NinjaTerm',
description: 'The serial port terminal that\'s got your back.',
start_url: './app',
theme_color: '#DC3545',
icons: [
{
src: icon192Url,
sizes: '192x192',
type: 'image/png',
},
{
src: icon512Url,
sizes: '512x512',
type: 'image/svg+xml',
purpose: 'any maskable'
},
{
src: icon512Url,
sizes: '512x512',
type: 'image/png',
}
]
},
})
],
server: {
// this ensures that the browser opens upon server start
open: true,
// this sets a default port to 3000
port: 3000,
},
resolve: {
alias: {
src: "/src",
},
},
optimizeDeps: {
include: ['@mui/material/Tooltip', '@emotion/styled', '@mui/material/Unstable_Grid2'],
},
test: {
// Match all test files in src/, these are unit tests. Do not
// match any files in test/, these are E2E tests run with Playwright
include: ['**/src/**/*.spec.[tj]s'],
exclude: [
'**/node_modules/**',
'**/dist/**',
],
testTimeout: 20000,
// browser: {
// enabled: true,
// name: 'chrome', // browser name is required
// },
environment: 'jsdom',
},
})