@@ -2,83 +2,80 @@ import react from '@vitejs/plugin-react'
2
2
import { defineConfig } from 'vite'
3
3
import { compression } from 'vite-plugin-compression2'
4
4
import dts from 'vite-plugin-dts'
5
- // import mkcert from 'vite-plugin-mkcert'
5
+ import mkcert from 'vite-plugin-mkcert'
6
6
import { VitePWA } from 'vite-plugin-pwa'
7
7
import svgr from 'vite-plugin-svgr'
8
8
import tsconfigPaths from 'vite-tsconfig-paths'
9
9
10
10
// https://vitejs.dev/config/
11
- export default defineConfig ( ( ) =>
12
- // { mode }
13
- {
14
- return {
15
- server : {
16
- port : 3000 ,
17
- strictPort : true ,
18
- proxy : {
19
- '^/ors/v2/directions/.*' : {
20
- target : 'http://112.162.84.70:8003' ,
21
- changeOrigin : true ,
22
- secure : false ,
23
- rewrite : path => path ,
24
- configure : ( proxy , options ) => {
25
- proxy . on ( 'error' , ( err , req , res ) => {
26
- console . log ( '프록시 에러:' , err )
27
- } )
28
- proxy . on ( 'proxyReq' , ( proxyReq , req , res ) => {
29
- console . log ( '프록시 요청:' , proxyReq . path )
30
- } )
31
- } ,
11
+ export default defineConfig ( ( { mode } ) => {
12
+ return {
13
+ server : {
14
+ port : 3000 ,
15
+ strictPort : true ,
16
+ proxy : {
17
+ '^/ors/v2/directions/.*' : {
18
+ target : 'http://112.162.84.70:8003' ,
19
+ changeOrigin : true ,
20
+ secure : false ,
21
+ rewrite : path => path ,
22
+ configure : ( proxy , options ) => {
23
+ proxy . on ( 'error' , ( err , req , res ) => {
24
+ console . log ( '프록시 에러:' , err )
25
+ } )
26
+ proxy . on ( 'proxyReq' , ( proxyReq , req , res ) => {
27
+ console . log ( '프록시 요청:' , proxyReq . path )
28
+ } )
32
29
} ,
33
30
} ,
34
31
} ,
35
- plugins : [
36
- react ( ) ,
37
- tsconfigPaths ( ) ,
38
- // ...(mode === 'development' ? [mkcert()] : []),
39
- svgr ( ) ,
40
- dts ( ) ,
41
- compression ( ) ,
42
- VitePWA ( {
43
- strategies : 'injectManifest' ,
44
- srcDir : 'src' ,
45
- filename : 'sw.ts' ,
46
- registerType : 'prompt' ,
47
- injectRegister : false ,
32
+ } ,
33
+ plugins : [
34
+ react ( ) ,
35
+ tsconfigPaths ( ) ,
36
+ ...( mode === 'development' ? [ mkcert ( ) ] : [ ] ) ,
37
+ svgr ( ) ,
38
+ dts ( ) ,
39
+ compression ( ) ,
40
+ VitePWA ( {
41
+ strategies : 'injectManifest' ,
42
+ srcDir : 'src' ,
43
+ filename : 'sw.ts' ,
44
+ registerType : 'prompt' ,
45
+ injectRegister : false ,
48
46
49
- pwaAssets : {
50
- disabled : false ,
51
- config : true ,
52
- } ,
47
+ pwaAssets : {
48
+ disabled : false ,
49
+ config : true ,
50
+ } ,
53
51
54
- manifest : {
55
- name : 'DDang' ,
56
- short_name : 'DDang' ,
57
- description : '반려견 산책 서비스' ,
58
- theme_color : '#ffffff' ,
59
- } ,
52
+ manifest : {
53
+ name : 'DDang' ,
54
+ short_name : 'DDang' ,
55
+ description : '반려견 산책 서비스' ,
56
+ theme_color : '#ffffff' ,
57
+ } ,
60
58
61
- injectManifest : {
62
- globPatterns : [ '**/*.{js,css,html,svg,png,ico}' ] ,
63
- } ,
59
+ injectManifest : {
60
+ globPatterns : [ '**/*.{js,css,html,svg,png,ico}' ] ,
61
+ } ,
64
62
65
- devOptions : {
66
- enabled : true ,
67
- navigateFallback : 'index.html' ,
68
- suppressWarnings : true ,
69
- type : 'module' ,
70
- } ,
71
- } ) ,
72
- ] ,
73
- build : {
74
- rollupOptions : {
75
- output : {
76
- manualChunks : {
77
- vendor : [ 'react' , 'react-dom' ] ,
78
- } ,
63
+ devOptions : {
64
+ enabled : true ,
65
+ navigateFallback : 'index.html' ,
66
+ suppressWarnings : true ,
67
+ type : 'module' ,
68
+ } ,
69
+ } ) ,
70
+ ] ,
71
+ build : {
72
+ rollupOptions : {
73
+ output : {
74
+ manualChunks : {
75
+ vendor : [ 'react' , 'react-dom' ] ,
79
76
} ,
80
77
} ,
81
78
} ,
82
- }
79
+ } ,
83
80
}
84
- )
81
+ } )
0 commit comments