-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.js
101 lines (98 loc) · 2.72 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig } from "vite";
import { readFileSync } from "fs";
import { fileURLToPath, URL } from "url";
import { VitePWA } from "vite-plugin-pwa";
import laravel, { refreshPaths } from "laravel-vite-plugin";
export default defineConfig(({ mode }) => {
let https = false;
if (mode === "development") {
https = {
cert: readFileSync("/etc/certs/cert.pem"),
key: readFileSync("/etc/certs/key.pem"),
};
}
return {
server: {
host: "0.0.0.0",
https,
port: 5173,
strictPort: true,
hmr: {
host: "hub.lan",
clientPort: 5173,
},
watch: {
ignored: ["**/storage/**"],
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./", import.meta.url)),
"~": fileURLToPath(new URL("./node_modules", import.meta.url)),
"!": fileURLToPath(new URL("./vendor", import.meta.url)),
},
},
plugins: [
laravel({
input: ["resources/css/app.css", "resources/js/app.js"],
refresh: [...refreshPaths, "resources/**", "src/**"],
}),
VitePWA({
outDir: "public/build",
base: "public",
buildBase: "/build/",
scope: "/",
registerType: "autoUpdate",
injectRegister: "script-defer",
workbox: {
cleanupOutdatedCaches: true,
directoryIndex: null,
globPatterns: ["**/*.{js,css,html,svg,jpg,png,webp,ico,txt,woff,woff2}"],
maximumFileSizeToCacheInBytes: 4194304,
navigateFallback: null,
navigateFallbackDenylist: [/\/[api,admin,livewire,vod]+\/.*/],
},
manifest: {
name: "Hub",
short_name: "Hub",
description: "Hub",
categories: ["videos", "vod"],
theme_color: "#030712",
background_color: "#030712",
display_override: ["fullscreen", "minimal-ui"],
display: "fullscreen",
orientation: "portrait-primary",
id: "/",
scope: "/",
start_url: "/",
icons: [
{
src: "/storage/images/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/storage/images/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
}),
],
build: {
chunkSizeWarningLimit: 1024,
rollupOptions: {
output: {
manualChunks: {
utils: ["axios"],
ws: ["pusher-js", "laravel-echo"],
player: ["shaka-player"],
pwa: ["virtual:pwa-register"],
},
},
},
},
};
});