-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
54 lines (53 loc) · 1.52 KB
/
vite.config.ts
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
/// <reference types="vitest/config" />
import { sentryVitePlugin } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import svgr from 'vite-plugin-svgr';
// https://vitejs.dev/config/
export default defineConfig({
esbuild: false,
build: {
sourcemap: true,
minify: true,
cssMinify: true,
},
plugins: [
svgr(),
react(),
nodePolyfills(),
...(process.env.VITE_NODE_ENV
? [
sentryVitePlugin({
org: process.env.VITE_SENTRY_ORG,
project: process.env.VITE_SENTRY_PROJECT,
ignore: ['node_modules', 'vite.config.ts'],
authToken: process.env.VITE_SENTRY_AUTH_TOKEN,
sourcemaps: {
assets: './dist/**',
},
release: process.env.VITE_SENTRY_RELEASE,
deploy: {
env: process.env.VITE_NODE_ENV,
},
}),
]
: []),
],
base: '',
define: {
"__NPM_PACKAGE_VERSION__": JSON.stringify(process.env.npm_package_version),
'process.env': {
// DO NOT EXPOSE THE ENTIRE process.env HERE - sensitive information on CI/CD could be exposed.
// defining here as an empty object as there are errors otherwise
},
'process.version': `"${process.version}"`,
},
resolve: {
alias: {
'@tests': path.resolve(__dirname) + '/tests',
'@src': path.resolve(__dirname) + '/src',
},
},
});