-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
80 lines (78 loc) · 1.59 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
import { defineConfig } from "vite";
import Vue from "@vitejs/plugin-vue";
import Pages from "vite-plugin-pages";
import WindiCSS from "vite-plugin-windicss";
import { minifyHtml } from "vite-plugin-html";
import { VitePWA } from "vite-plugin-pwa";
import Autoprefixer from "autoprefixer";
export default defineConfig({
plugins: [
Vue(),
Pages(),
WindiCSS(),
minifyHtml(),
VitePWA({
strategies: "injectManifest",
filename: "sw.js",
injectRegister: "auto",
injectManifest: {
dontCacheBustURLsMatching: /assets\/.*/,
},
manifest: {
background_color: "#20262e",
description: "Guess the Pokemon!",
name: "PokeGuess",
short_name: "PokeGuess",
theme_color: "#8dd0ff",
icons: [
{
src: "/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/maskable_icon_x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
}),
],
server: {
fs: {
allow: ["."],
strict: true,
},
},
css: {
postcss: {
plugins: [Autoprefixer()],
},
},
build: {
rollupOptions: {
output: {
manualChunks: id => {
if (id.includes("node_modules/vue")) return "vendor/vue";
if (id.includes("node_modules/primevue")) return "vendor/primevue";
if (id.includes("node_modules/date-fns")) return "vendor/date-fns";
},
},
},
terserOptions: {
compress: {
passes: 3,
},
},
},
define: {
__VUE_OPTIONS_API__: false,
},
});