-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
53 lines (51 loc) · 1.38 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
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-stdlib-browser';
import svgr from 'vite-plugin-svgr';
// https://vitejs.dev/config/
export default defineConfig({
base: '',
esbuild: false,
build: {
sourcemap: true,
minify: true,
cssMinify: true,
},
plugins: [
svgr(),
react(),
nodePolyfills(),
// if we are building for permaweb deploy we dont want sentry
...(process.env.VITE_NODE_ENV && !process.env.DEPLOY_ANT_PROCESS_ID
? [
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,
},
}),
]
: []),
],
define: {
'process.env': process.env,
VITE_CONFIG: {
version: JSON.stringify(process.env.npm_package_version),
},
},
resolve: {
alias: {
'@tests': path.resolve(__dirname) + '/tests',
'@src': path.resolve(__dirname) + '/src',
},
},
});