-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
63 lines (61 loc) · 1.86 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
/// <reference types="vitest" />
// import { visualizer } from 'rollup-plugin-visualizer';
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
import svgr from 'vite-plugin-svgr';
import { execSync } from 'child_process';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
// Make sure release is set client-side, automatic release tagging did not work
process.env.VITE_SENTRY_RELEASE = execSync('git rev-parse HEAD').toString().trim();
return {
appType: 'spa',
build: {
sourcemap: true,
manifest: 'asset-manifest.json',
outDir: 'build'
},
plugins: [
react({
babel: {
babelrc: true
}
}),
svgr(),
createHtmlPlugin({
template: 'index.html',
minify: true,
inject: {
data: {
VITE_DEKORATOR_URL: env.VITE_DEKORATOR_URL
}
}
})
// visualizer({
// filename: 'bundle-stats.html'
// })
],
server: {
port: 3000
},
test: {
environment: 'jsdom',
include: ['**/*.test.ts', '**/*.test.tsx'],
globals: true,
setupFiles: ['./src/test/setup.tsx'],
coverage: {
provider: 'v8',
include: ['src'],
exclude: [
'src/mock',
'src/stories',
'src/**.test.ts',
'src/**/**.test.tsx',
'src/global.d.ts',
'src/polyfill.ts'
]
}
}
};
});