-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
63 lines (60 loc) · 1.97 KB
/
vite.config.ts
File metadata and controls
63 lines (60 loc) · 1.97 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
import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte"
import { defineConfig } from "vite"
import { VitePWA } from "vite-plugin-pwa"
export default defineConfig(({ mode }) => ({
base: "./",
build: {
target: "es2022",
},
// Silence SASS nested deprecation warning
// see https://sass-lang.com/documentation/breaking-changes/mixed-decls/
css: {
preprocessorOptions: {
sass: {
api: "modern",
silenceDeprecations: ["mixed-decls"],
},
},
},
plugins: [
svelte({
preprocess: vitePreprocess(),
compilerOptions: mode === "development"
? {}
: { cssHash: ({ css, hash }) => `h${hash(css).slice(0, 6)}` },
}),
VitePWA({
registerType: "autoUpdate",
injectRegister: "inline",
devOptions: { enabled: mode === "development" },
workbox: {
globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
},
manifest: {
name: "phichess",
short_name: "phichess",
description: "Play over the board chess on any device",
display: "standalone",
start_url: "./",
scope: "./",
theme_color: "#222222",
background_color: "#f0d9b5",
icons: [
{ src: "./icons/phichess-512.png", sizes: "512x512", type: "image/png" },
{ src: "./icons/phichess-256.png", sizes: "256x256", type: "image/png" },
{ src: "./icons/phichess-192.png", sizes: "192x192", type: "image/png" },
{ src: "./icons/phichess-144.png", sizes: "144x144", type: "image/png" },
{ src: "./icons/phichess-128.png", sizes: "128x128", type: "image/png" },
{ src: "./icons/phichess-64.png", sizes: "64x64", type: "image/png" },
{ src: "./icons/phichess-32.png", sizes: "32x32", type: "image/png" },
{
src: "./icons/phichess-512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
}),
],
}))