-
Notifications
You must be signed in to change notification settings - Fork 11
/
vite.config.ts
111 lines (108 loc) · 2.55 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
/* eslint-disable no-undef */
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import svgLoader from "vite-svg-loader";
import { VitePWA } from "vite-plugin-pwa";
import viteCompression from "vite-plugin-compression";
const path = require("path");
export default defineConfig({
base: "./",
plugins: [
vue(),
svgLoader(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
manifest: {
name: "Swing Music",
short_name: "Swing Music",
description: "Swing Music",
theme_color: "#111",
icons: [
{
src: "pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
shortcuts: [
{
name: "Playlists",
description: "View your playlists",
url: "/#/playlists",
icons: [
{
src: "/icons/playlist.svg",
type: "image/svg+xml",
},
],
},
{
name: "Favorites",
description: "View your favorites",
url: "/#/favorites",
icons: [
{
src: "/icons/heart.svg",
type: "image/svg+xml",
},
],
},
{
name: "Settings",
description: "Modify settings",
url: "/#/settings",
icons: [
{
src: "/icons/settings.svg",
type: "image/svg+xml",
},
],
},
],
start_url: "/",
display: "standalone",
background_color: "rgba(0, 0, 0, 0.95)",
},
}),
viteCompression({
threshold: 150,
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/assets/scss/_variables.scss", "@/assets/scss/_mixins.scss";`,
},
},
},
build: {
reportCompressedSize: false,
chunkSizeWarningLimit: 1500,
emptyOutDir: true,
},
});