-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.ts
143 lines (140 loc) · 3.61 KB
/
vite.config.ts
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue2";
import * as path from "path";
import { execSync } from "child_process";
import eslintPlugin from "vite-plugin-eslint";
import { VitePWA } from "vite-plugin-pwa";
const VUE_APP_GIT_COMMIT_INFO = execSync(
'git log -n 10 --pretty=format:";;;;;%H;%aI;%an;%B"',
)
.toString()
.trim();
const VUE_APP_GIT_BRANCH = execSync("git branch --show-current")
.toString()
.trim();
// https://vitejs.dev/config/
export default defineConfig({
define: {
VUE_APP_GIT_COMMIT_INFO: JSON.stringify(VUE_APP_GIT_COMMIT_INFO),
VUE_APP_GIT_BRANCH: JSON.stringify(VUE_APP_GIT_BRANCH),
},
build: {
target: "esnext",
sourcemap: true,
},
plugins: [
vue(),
eslintPlugin({
fix: true,
}),
VitePWA({
registerType: "autoUpdate",
workbox: {
sourcemap: true,
},
includeAssets: ["favicon.ico", "robots.txt"],
manifest: {
id: "/#/posts",
name: "Material e621",
short_name: "Material e6", // maximum of 12 characters recommended by chromium devs
start_url: "/#/posts",
scope: "/",
display: "fullscreen",
background_color: "#000000",
theme_color: "#000000",
description:
"Material e621 is a modern, open source web client for e621.net. It is customizable, comes with a bunch of additional features that are not available on e621.net, and makes browsing posts a delightful experience.",
orientation: "any",
lang: "en",
icons: [
{
src: "/static/8x8.png",
sizes: "8x8",
type: "image/png",
},
{
src: "/static/16x16.png",
sizes: "16x16",
type: "image/png",
},
{
src: "/static/24x24.png",
sizes: "24x24",
type: "image/png",
},
{
src: "/static/32x32.png",
sizes: "32x32",
type: "image/png",
},
{
src: "/static/48x48.png",
sizes: "48x48",
type: "image/png",
},
{
src: "/static/64x64.png",
sizes: "64x64",
type: "image/png",
},
{
src: "/static/72x72.png",
sizes: "72x72",
type: "image/png",
},
{
src: "/static/96x96.png",
sizes: "96x96",
type: "image/png",
},
{
src: "/static/128x128.png",
sizes: "128x128",
type: "image/png",
},
{
src: "/static/144x144.png",
sizes: "144x144",
type: "image/png",
},
{
src: "/static/168x168.png",
sizes: "168x168",
type: "image/png",
},
{
src: "/static/192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/static/256x256.png",
sizes: "256x256",
type: "image/png",
},
{
src: "/static/512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/static/1024x1024.png",
sizes: "1024x1024",
type: "image/png",
},
{
src: "favicon.svg",
sizes: "512x512",
type: "image/svg",
purpose: "any maskable",
},
],
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});