-
Notifications
You must be signed in to change notification settings - Fork 10
/
vite.config.js
127 lines (125 loc) · 3.36 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
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
119
120
121
122
123
124
125
126
127
import { VitePWA } from 'vite-plugin-pwa';
import { createHtmlPlugin } from 'vite-plugin-html';
import { defineConfig } from 'vite';
import { version } from './package.json';
import { defaults } from './src/js/defaults.js';
export default defineConfig({
root: 'src',
build: {
outDir: '../build',
},
publicDir: '../public',
base: './',
outDir: './',
appType: 'spa',
plugins: [
createHtmlPlugin({
template: 'index.html',
inject: {
data: {
options: {
appName: defaults.appName,
author: defaults.author,
description: defaults.description,
keywords: defaults.keywords,
loadingText: defaults.loadingText,
themeColor: defaults.themeColor,
title: defaults.title,
versionString: defaults.versionString,
},
},
},
}),
VitePWA({
strategies: 'generateSW',
injectRegister: 'auto',
registerType: 'prompt',
filename: 'service-worker.js',
manifestFilename: 'localweather.webmanifest',
workbox: {
navigateFallbackDenylist: [/^\/api/],
clientsClaim: true,
skipWaiting: true,
cleanupOutdatedCaches: true,
},
includeAssets: [
'./images/weather-icon-32.png',
'./images/weather-icon-64.png',
'./images/weather-icon-128.png',
],
manifest: {
name: 'LocalWeather.dev (powered by Visual Crossing)',
short_name: 'LocalWeather',
description: 'Minimalist local weather app powered by Visual Crossing',
version,
icons: [
{
src: './images/weather-icon-32.png',
type: 'image/png',
sizes: '32x32',
},
{
src: './images/weather-icon-48.png',
type: 'image/png',
sizes: '48x48',
},
{
src: './images/weather-icon-64.png',
type: 'image/png',
sizes: '64x64',
},
{
src: './images/weather-icon-72.png',
type: 'image/png',
sizes: '72x72',
},
{
src: './images/weather-icon-96.png',
type: 'image/png',
sizes: '96x96',
},
{
src: './images/weather-icon-128.png',
type: 'image/png',
sizes: '128x128',
},
{
src: './images/weather-icon-128.png',
type: 'image/png',
sizes: '128x128',
},
{
src: './images/weather-icon-152.png',
type: 'image/png',
sizes: '152x152',
},
{
src: './images/weather-icon-167.png',
type: 'image/png',
sizes: '167x167',
},
{
src: './images/weather-icon-180.png',
type: 'image/png',
sizes: '180x180',
},
{
src: './images/weather-icon-512.png',
type: 'image/png',
sizes: '512x512',
},
],
homepage_url: 'https://localweather.dev/',
lang: 'en-US',
dir: 'auto',
orientation: 'portrait',
id: '/',
scope: '/',
start_url: '/',
display: 'standalone',
background_color: '#133150',
theme_color: '#133150',
},
}),
],
});