-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
121 lines (120 loc) · 3.19 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
115
116
117
118
119
120
121
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { fileURLToPath, URL } from 'url';
import { defineConfig } from 'vite';
import Vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
import mkcert from 'vite-plugin-mkcert';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
Vue({
include: [/\.vue$/, /\.md$/],
}),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.js',
injectManifest: {
injectionPoint: undefined,
rollupFormat: 'iife',
globPatterns: ['**/*.{html}'],
},
manifest: {
// Modify manifest options here...
name: 'ROAR Dashboard',
short_name: 'ROAD',
start_url: '.',
display: 'standalone',
theme_color: '#ffffff',
background_color: '#ffffff',
injectRegister: 'manual',
icons: [
{
src: '/pwa-64x64.png',
sizes: '64x64',
type: 'image/png',
},
{
src: '/pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: '/maskable-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
/* enable sw on development */
devOptions: {
enabled: true,
type: 'module',
navigateFallback: 'index.html',
suppressWarnings: true,
},
}),
...(process.env.NODE_ENV === 'development' ? [mkcert()] : []),
nodePolyfills({
globals: {
process: true,
},
}),
...(process.env.NODE_ENV !== 'development'
? [
sentryVitePlugin({
org: 'roar-89588e380',
project: 'dashboard',
}),
]
: []),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
vue: 'vue/dist/vue.esm-bundler.js',
},
},
server: {
fs: {
allow: ['..'],
},
},
build: {
cssCodeSplit: true,
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
lodash: ['lodash'],
tanstack: ['@tanstack/vue-query'],
chartJs: ['chart.js'],
sentry: ['@sentry/browser', '@sentry/integrations', '@sentry/vue', '@sentry/wasm'],
fluency: ['@bdelab/roam-fluency'],
firekit: ['@bdelab/roar-firekit'],
letter: ['@bdelab/roar-letter'],
multichoice: ['@bdelab/roar-multichoice'],
phoneme: ['@bdelab/roar-pa'],
sre: ['@bdelab/roar-sre'],
swr: ['@bdelab/roar-swr'],
utils: ['@bdelab/roar-utils'],
vocab: ['@bdelab/roar-vocab'],
ran: ['@bdelab/roav-ran'],
crowding: ['@bdelab/roav-crowding'],
'roav-mep': ['@bdelab/roav-mep'],
},
},
},
},
optimizeDeps: {
include: ['@bdelab/roar-firekit', 'vue-google-maps-community-fork', 'fast-deep-equal'],
},
});