-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
114 lines (112 loc) · 3.63 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
102
103
104
105
106
107
108
109
110
111
112
113
114
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";
// import { VitePWA } from 'vite-plugin-pwa';
import mkcert from "vite-plugin-mkcert";
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
import path from 'path';
export default defineConfig({
server: {
https: true,
host: "localhost",
hmr: {
host: "localhost",
},
// hmr: {
// clientPort: 27,
// },
},
plugins: [
laravel({
input: ['resources/js/app.js'],
ssr: "resources/js/ssr.js",
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
// VitePWA({
// registerType: 'autoUpdate',
// selfDestroying: true,
// // outDir: 'public/build'
// outDir: path.resolve(__dirname, 'public'),
// buildBase: '/',
// scope: '/',
// base: '/',
// // buildBase: '/build/',
// // scope: '/',
// injectRegister: 'auto',
// // workbox: {
// // sourcemap: true
// // },
// workbox: {
// globDirectory: path.resolve(__dirname, 'public'),
// swDest : 'public/sw.js',
// globPatterns : [
// '{build,images,sounds}/**/*.{js,css,html,ico,png,jpg,mp4,svg}'
// ],
// // globPatterns: ['**/*.{js,css,ico,png,svg}'],
// cleanupOutdatedCaches: false,
// runtimeCaching: [
// {
// urlPattern: '/^\/app\/$/',
// handler: 'NetworkFirst',
// options: {
// cacheName: 'app',
// expiration: {
// maxEntries: 10,
// maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
// },
// cacheableResponse: {
// statuses: [200]
// },
// }
// }
// ]
// },
// manifest: {
// name: 'My Awesome App',
// short_name: 'MyApp',
// description: 'My Awesome App description',
// theme_color: '#ffffff',
// icons: [
// {
// src: '/images/pwa-192x192.png',
// sizes: '192x192',
// type: 'image/png'
// },
// {
// src: '/images/pwa-512x512.png',
// sizes: '512x512',
// type: 'image/png',
// purpose: "any maskable"
// }
// ]
// } // your manifest to pwa with your icons and names
// }),
mkcert(),
chunkSplitPlugin()
],
build: {
chunkSizeWarningLimit: 1600,
emptyOutDir: true,
rollupOptions: {
output: {
entryFileNames: "[name].js",
chunkFileNames: "[name].js",
assetFileNames: "[name].[ext]",
},
},
},
ssr: {
noExternal: [
'@inertiajs/server',
'laravel-vite-plugin',
],
},
});