-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mts
76 lines (69 loc) · 1.99 KB
/
vite.config.mts
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
import {defineConfig} from 'vite';
import {VitePWA} from 'vite-plugin-pwa';
import Unfonts from 'unplugin-fonts/vite';
import {workboxConfig} from './scripts/workbox.config.mts';
import {getYarnCachePath} from './scripts/yarn-cache.config.mts';
import {description} from './package.json';
export default defineConfig(async ({command, mode}) => {
const yarnCachePath = await getYarnCachePath();
console.log({
command,
mode,
yarnCachePath,
});
return {
base: '/',
clearScreen: true,
css: {
postcss: 'postcss.config.mjs',
},
build: {
sourcemap: true,
target: ['esnext', 'edge100', 'firefox100', 'chrome100', 'safari18'],
},
plugins: [
VitePWA({
manifest: {
id: '/',
scope: '/?pwa',
name: 'Hybrid Theme Builder',
display: 'standalone',
start_url: '/',
short_name: 'HTB',
theme_color: '#d84113',
description,
orientation: 'portrait',
background_color: '#d84113',
icons: [
{src: '/favicon.ico', type: 'image/x-icon', sizes: '16x16'},
{src: '/icon-192.png', type: 'image/png', sizes: '192x192', purpose: 'any'},
{src: '/icon-512.png', type: 'image/png', sizes: '512x512', purpose: 'any'},
{src: '/icon-192-maskable.png', type: 'image/png', sizes: '192x192', purpose: 'maskable'},
{src: '/icon-512-maskable.png', type: 'image/png', sizes: '512x512', purpose: 'maskable'},
],
},
workbox: workboxConfig(),
devOptions: {
enabled: false,
},
}),
Unfonts({
fontsource: {
families: ['Varela Round'],
},
google: {
families: [
{
name: 'Roboto',
styles: 'wght@300',
defer: true,
},
],
display: 'swap',
injectTo: 'head-prepend',
preconnect: true,
},
}),
],
};
});