-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
69 lines (68 loc) · 1.74 KB
/
Copy pathvite.config.ts
File metadata and controls
69 lines (68 loc) · 1.74 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
66
67
68
69
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig(({ mode }) => ({
// 一部の依存 (@elzup/kit, styled-components 等) が参照する process.env.NODE_ENV を
// ブラウザ向けに実体化する。無いと resize 等の経路で "process is not defined" になる。
define: {
'process.env.NODE_ENV': JSON.stringify(mode),
},
plugins: [
react({
babel: {
plugins: [
[
'babel-plugin-styled-components',
{ displayName: true, preprocess: false },
],
],
},
}),
// eslint-disable-next-line new-cap
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['images/icon.png', 'images/icon-4x.png'],
manifest: {
short_name: 'Mitelop',
name: 'Mitelop',
start_url: '/',
display: 'standalone',
theme_color: '#2B0065',
icons: [
{
src: '/images/icon-4x.png',
type: 'image/png',
sizes: '192x192',
},
{
src: '/images/icon-512w.png',
type: 'image/png',
sizes: '512x512',
},
],
protocol_handlers: [
{
protocol: 'mitelop',
url: '/%s',
},
],
shortcuts: [
{
name: 'Clock',
short_name: 'clock',
url: '/clock',
},
{
name: 'Timer',
short_name: 'timer',
url: '/timer',
},
],
},
workbox: {
navigateFallback: '/',
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
},
}),
],
}))