-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
105 lines (103 loc) · 2.98 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
import {resolve} from 'path'
import {defineConfig, loadEnv} from 'vite';
import replace from '@rollup/plugin-replace';
import {createHtmlPlugin} from "vite-plugin-html";
import minify from "vite-plugin-minify";
import vue from '@vitejs/plugin-vue'
import vuetify from "vite-plugin-vuetify";
import VitePluginRadar from "vite-plugin-radar";
import {VitePWA} from "vite-plugin-pwa";
export default mode => {
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
return defineConfig({
build: {
reportCompressedSize: false,
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
about: resolve(__dirname, 'about/index.html')
}
}
},
esbuild: {
legalComments: "none"
},
plugins: [
replace({
__SENTRY_DEBUG__: false,
__SENTRY_TRACING__: false,
preventAssignment: true,
}),
createHtmlPlugin({minify: false}),
minify({
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
keepClosingSlash: false,
noNewlinesBeforeTagClose: true,
processConditionalComments: false,
removeComments: true,
removeEmptyAttributes: true,
removeEmptyElements: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
}),
VitePluginRadar({
analytics: {
id: process.env.VITE_GOOGLE_ANALYTICS_ID,
},
}),
vue(),
vuetify({styles: {configFile: 'src/settings.scss'}}),
VitePWA({
injectRegister: 'inline',
manifest: {
"background_color": "#ffffff",
"display": "standalone",
"name": "Workplaces in Cyprus",
"short_name": "Workplaces in Cyprus",
"start_url": "/?utm_source=homescreen",
"theme_color": "#ffffff",
"icons": [
{
"src": "icon.svg",
"type": "image/svg",
"sizes": "any"
},
{
"src": "icon-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "icon-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "icon-maskable-192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "maskable"
},
{
"src": "icon-maskable-512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
},
workbox: {
globPatterns: ['**/*.{css,html,ico,jpg,js,png,svg,txt,webp}'],
runtimeCaching: [{
handler: 'StaleWhileRevalidate',
urlPattern: /\.(?:cur|jpg|jpeg|json|png|svg|webp)$/
}],
},
})
],
});
}