forked from cpe-kmutt-student/engineering-openhouse-2024
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (62 loc) · 1.65 KB
/
vite.config.ts
File metadata and controls
65 lines (62 loc) · 1.65 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
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import eslint from 'vite-plugin-eslint'
import { VitePWA } from 'vite-plugin-pwa'
import * as path from 'path'
import tsconfigPaths from 'vite-tsconfig-paths'
const ENV_PREFIX = 'APP_'
export default defineConfig(({ mode }) => {
process.env = loadEnv(mode, process.cwd(), '')
return {
base: '/',
plugins: [
react(),
eslint(),
VitePWA({
registerType: 'autoUpdate',
selfDestroying: true,
includeAssets: ['favicon.ico', 'logo.svg'],
manifest: {
name: 'Engineering Carnival 2023',
short_name: 'Engineering Carnival 2023',
description: 'Engineering Open house Carnival at Bangmod 2023',
start_url: '/',
background_color: '#450801',
theme_color: '#FFFFFF',
icons: [
{
src: '/contents/images/logo.svg',
},
{
src: '/contents/images/landing-background.svg',
},
{
src: '/contents/images/SmoLogo.svg',
},
],
},
workbox: {
cleanupOutdatedCaches: true,
sourcemap: true,
globPatterns: ['**/*.{js,css,html,ico,png,jpg,webp,svg,webmanifest}'],
},
devOptions: {
enabled: false,
type: 'module',
},
}),
tsconfigPaths(),
],
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
},
envPrefix: ENV_PREFIX,
server: {
port: 3000,
},
preview: {
host: '0.0.0.0',
port: 8000,
},
}
})