-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
118 lines (113 loc) · 3.01 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { compression } from 'vite-plugin-compression2'
import dts from 'vite-plugin-dts'
import mkcert from 'vite-plugin-mkcert'
import { VitePWA } from 'vite-plugin-pwa'
import svgr from 'vite-plugin-svgr'
import tsconfigPaths from 'vite-tsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
server: {
port: 3000,
strictPort: true,
proxy: {
'^/ors/v2/directions/.*': {
target: 'http://112.162.84.70:8003',
changeOrigin: true,
secure: false,
rewrite: path => path,
configure: (proxy, options) => {
proxy.on('error', (err, req, res) => {
console.log('프록시 에러:', err)
})
proxy.on('proxyReq', (proxyReq, req, res) => {
console.log('프록시 요청:', proxyReq.path)
})
},
},
},
},
plugins: [
react(),
tsconfigPaths(),
...(mode === 'development' ? [mkcert()] : []),
svgr(),
dts(),
compression(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
registerType: 'autoUpdate',
injectRegister: false,
pwaAssets: {
disabled: false,
config: true,
},
manifest: {
name: 'DDang',
short_name: 'DDang',
start_url: '/',
description: '반려견 산책 서비스',
theme_color: '#783D16', //?
background_color: '#783D16', //?
display: 'standalone',
categories: ['lifestyle', 'pets'],
icons: [
{
src: '/icons/pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/icons/pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: '/icons/maskable-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
{
src: '/icons/apple-touch-icon-180x180.png',
sizes: '180x180',
type: 'image/png',
purpose: 'apple touch icon',
},
{
src: '/icons/pwa-64x64.png',
sizes: '64x64',
type: 'image/png',
},
],
},
useCredentials: true,
injectManifest: {
globPatterns: ['**/*.{js,css,html,svg,png,ico}'],
},
devOptions: {
enabled: true,
navigateFallback: 'index.html',
suppressWarnings: true,
type: 'module',
},
}),
],
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
},
},
},
},
define: {
global: 'window',
},
}
})