-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
99 lines (94 loc) · 2.38 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
import ViteComponents from 'vite-plugin-components'
import Voie from 'vite-plugin-voie'
import PurgeIcons from 'vite-plugin-purge-icons'
import vue from '@vitejs/plugin-vue'
// import { VitePWA } from 'vite-plugin-pwa'
import alias from '@rollup/plugin-alias'
import WindiCSS from 'vite-plugin-windicss'
const moduleExclude = (match) => {
const m = (id) => id.indexOf(match) > -1
return {
name: `exclude-${match}`,
resolveId(id) {
if (m(id)) return id
},
load(id) {
if (m(id)) return `export default {}`
},
}
}
export default {
build: {
rollupOptions: {
external: ['text-encoding', '@peculiar/webcrypto'],
},
},
server: {
port: 3060,
},
optimizeDeps: {
include: [
'gun',
'gun/gun',
'gun/sea',
'gun/sea.js',
'gun/lib/then',
'gun/lib/webrtc',
'gun/lib/radix',
'gun/lib/radisk',
'gun/lib/store',
'gun/lib/rindexed',
],
},
plugins: [
WindiCSS(),
moduleExclude('text-encoding'),
// VitePWA({
// manifest: {
// name: 'ЭТОВОТЭТО',
// theme_color: '#999',
// icons: [
// {
// src: '/icons/logo192.png',
// type: 'image/png',
// sizes: '192x192',
// },
// {
// src: '/icons/logo512.png',
// type: 'image/png',
// sizes: '512x512',
// },
// ],
// },
// }),
alias({
entries: [
{ find: /^store\@(.*)/, replacement: '/src/store/$1.js' },
{ find: /^use\@(.*)/, replacement: '/src/use/$1.js' },
{ find: /^model\@(.*)/, replacement: '/src/model/$1.js' },
{ find: /^components\@(.*)/, replacement: '/src/components/$1.js' },
],
}),
vue(),
Voie({
extensions: ['vue', 'md'],
importMode: 'sync',
}),
ViteComponents({
// relative paths to the directory to search for components.
dirs: ['src/components'],
// valid file extensions for components.
extensions: ['vue'],
// search for subdirectories
deep: true,
// Allow subdirectories as namespace prefix for components.
directoryAsNamespace: true,
// Subdirectory paths for ignoring namespace prefixes
// works when `directoryAsNamespace: true`
globalNamespaces: [],
}),
PurgeIcons({
/* PurgeIcons Options */
}),
],
}