This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
80 lines (78 loc) · 2.46 KB
/
vite.config.js
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 { fileURLToPath, URL } from "url"
import { defineConfig, loadEnv } from "vite"
import vue from "@vitejs/plugin-vue"
import { VitePWA } from "vite-plugin-pwa"
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite"
const env = loadEnv("production", process.cwd(), "")
let build_source_map = true
if (env.CF_PAGES == "1") {
build_source_map = false
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueI18nPlugin({
compositionOnly: true,
fullInstall: false,
defaultSFCLang: "json",
}),
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"favicon.ico",
"android-chrome-192x192.png",
"android-chrome-512x512-maskable.png",
"android-chrome-512x512.png",
"apple-touch-icon.png",
"icon.svg",
],
workbox: {
cleanupOutdatedCaches: true,
sourcemap: build_source_map,
globPatterns: ["**/*.{woff2,html,js,css,png,webp,jpg,svg}"],
globIgnores: ["og.png"],
},
manifest: {
name: "streaming-list",
short_name: "streaming-list",
display: "standalone",
theme_color: "#343a40",
background_color: "#343a40",
icons: [
{
src: "/favicon/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/favicon/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/favicon/android-chrome-512x512-maskable.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"vue-i18n": "vue-i18n/dist/vue-i18n.runtime.esm-bundler.js",
},
},
build: {
manifest: false,
minify: "esbuild",
ssrManifest: false,
},
server: {
host: "127.0.0.1",
port: 3000,
},
})