generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
43 lines (42 loc) · 912 Bytes
/
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
import { defineConfig } from 'vite';
import eslint from '@nabla/vite-plugin-eslint';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
build: {
outDir: './build',
target: 'esnext',
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules')) {
if (id.includes('react')) {
return 'vendor__react';
}
if (id.includes('firebase')) {
return 'vendor__firebase';
}
return 'vendor';
}
},
},
},
},
plugins: [
mode === 'development' && eslint(),
react(),
svgr({ exportAsDefault: true }),
],
server: { open: true, port: 3000 },
test: {
globals: true,
environment: 'jsdom',
server: {
deps: {
inline: ['@the-collab-lab/shopping-list-utils'],
},
},
setupFiles: './tests/setup.js',
},
}));