-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathvite.config.js
More file actions
70 lines (69 loc) · 1.44 KB
/
vite.config.js
File metadata and controls
70 lines (69 loc) · 1.44 KB
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import frappeui from 'frappe-ui/vite'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [
frappeui({
frappeProxy: true,
lucideIcons: true,
jinjaBootData: true,
frappeTypes: {
input: {},
},
buildConfig: {
indexHtmlPath: '../lms/www/lms.html',
},
}),
vue({
script: {
defineModel: true,
propsDestructure: true,
},
}),
VitePWA({
registerType: 'autoUpdate',
devOptions: {
enabled: true,
},
workbox: {
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
globDirectory: '/assets/lms/frontend',
globPatterns: ['**/*.{js,ts,css,html,png,svg}'],
runtimeCaching: [
{
urlPattern: ({ request }) =>
request.destination === 'document',
handler: 'NetworkFirst',
options: {
cacheName: 'html-cache',
},
},
],
},
manifest: false,
}),
],
server: {
host: '0.0.0.0', // Accept connections from any network interface
allowedHosts: ['ps', 'fs', 'home'], // Explicitly allow this host
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
optimizeDeps: {
include: [
'feather-icons',
'engine.io-client',
'interactjs',
'highlight.js',
'plyr',
],
exclude: mode === 'production' ? [] : ['frappe-ui'],
},
}))