-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathvite.config.ts
More file actions
54 lines (52 loc) · 1.15 KB
/
vite.config.ts
File metadata and controls
54 lines (52 loc) · 1.15 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
import react from '@vitejs/plugin-react';
import path from 'path';
import { loadEnv } from 'vite';
import eslint from 'vite-plugin-eslint';
import mkcert from 'vite-plugin-mkcert';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
assetsInclude: ['**/*.svg', '**/*.png', '**/*.wav'],
build: {
outDir: path.resolve(__dirname, 'dist'),
rollupOptions: {
input: path.resolve(__dirname, 'index.html'),
},
},
plugins: [
svgr({
svgrOptions: {
ref: true,
},
}),
eslint({
failOnError: false,
failOnWarning: false,
}),
react({
include: '**/*.{jsx,tsx}',
}),
tsconfigPaths(),
mkcert(), // if testing against a http localhost backend, remove
],
server: {
hmr: {
overlay: false,
},
host: true,
port: 3000,
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.js',
deps: {
inline: ['react-chatbotify'],
},
pool: "vmThreads",
},
});
};