-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
67 lines (66 loc) · 2.51 KB
/
vite.config.js
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import path from 'path';
import fs from 'fs';
export default defineConfig({
base: '/',
plugins: [
react(),
// PWA 플러그인 설정 수정
VitePWA({
registerType: 'autoUpdate', // 서비스 워커 자동 업데이트
includeAssets: ['/icons/pwa-192.png', '/icons/pwa-512.png'], // 로컬 경로의 이미지 참조
manifest: {
name: 'My Vite PWA App', // PWA 애플리케이션의 전체 이름
short_name: 'VitePWA', // 홈 화면에 표시될 이름
description: 'This is my Vite PWA application', // 설명
theme_color: '#ffffff', // 테마 색상
background_color: '#ffffff', // 배경 색상
display: 'standalone', // 브라우저 요소 제거
scope: '/', // PWA가 적용될 URL 범위
start_url: '/', // 애플리케이션의 시작 URL
icons: [
{
src: '/icons/pwa-192.png', // 로컬 경로의 192x192 아이콘
sizes: '192x192', // 아이콘 크기
type: 'image/png'
},
{
src: '/icons/pwa-512.png', // 로컬 경로의 512x512 아이콘
sizes: '512x512', // 아이콘 크기
type: 'image/png'
},
{
src: '/icons/pwa-512.png', // 로컬 경로의 마스크 가능 아이콘
sizes: '512x512',
type: 'image/png',
purpose: 'maskable' // 마스크 가능 속성 추가
}
]
}
})
],
server: process.env.NODE_ENV === 'development' ? {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'localhost.pem')),
},
} : {},
resolve: {
alias: {
'@atoms': path.resolve(__dirname, 'src/atoms'),
'@components': path.resolve(__dirname, 'src/components'),
'@constants': path.resolve(__dirname, 'src/constant'),
'@contexts': path.resolve(__dirname, 'src/contexts'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@layouts': path.resolve(__dirname, 'src/layouts'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@routes': path.resolve(__dirname, 'src/routes'),
'@services': path.resolve(__dirname, 'src/services'),
'@styles': path.resolve(__dirname, 'src/styles'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@public': path.resolve(__dirname, 'public'),
},
},
});