-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.js
77 lines (76 loc) · 1.7 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
import { defineConfig } from 'vite'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
root: 'src',
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'SPEX',
theme_color: '#35363a',
icons: [
{
src: '/img/icons/favicon.svg',
sizes: 'any',
type: 'image/svg+xml',
},
{
src: '/img/icons/favicon-32x32.png',
sizes: '32x32',
type: 'image/png',
},
{
src: '/img/icons/favicon-16x16.png',
sizes: '16x16',
type: 'image/png',
},
{
src: '/img/icons/apple-touch-icon.png',
sizes: 'any',
type: 'image/png',
},
{
src: '/img/icons/safari-pinned-tab.svg',
sizes: 'any',
type: 'image/svg+xml',
},
{
src: '/img/icons/msapplication-icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
],
}
})
],
define: {
global: 'window',
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
}
},
resolve: {
alias: {
stream: 'readable-stream',
},
},
optimizeDeps: {
esbuildOptions: {
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
],
},
include: ['dagre'],
},
build: {
outDir: '../dist',
emptyOutDir: true,
}
})