-
Notifications
You must be signed in to change notification settings - Fork 11
/
vite.config.ts
84 lines (74 loc) · 1.97 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
const COMMIT_SHA =
process.env['GIT_COMMIT_SHA'] ??
process.env['NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA'] ??
process.env['VERCEL_GIT_COMMIT_SHA'];
const distDir = '../../dist/apps/vesting';
export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/vesting',
server: {
port: 4200,
host: 'localhost',
},
preview: {
port: 4300,
host: 'localhost',
},
plugins: [
react(),
nxViteTsPaths(),
nodePolyfills({
globals: {
Buffer: true,
global: true,
},
}),
sentryVitePlugin({
org: 'haqq-network',
project: 'vesting-app',
authToken: process.env['SENTRY_AUTH_TOKEN'],
release: {
name: COMMIT_SHA ?? 'development',
deploy: {
env: process.env['VERCEL_ENV'] ?? 'development',
},
dist: distDir,
},
reactComponentAnnotation: {
enabled: true,
},
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
build: {
outDir: distDir,
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
sourcemap: true,
},
define: {
'process.env.GIT_COMMIT_SHA': JSON.stringify(COMMIT_SHA),
'process.env.WALLETCONNECT_PROJECT_ID': JSON.stringify(
process.env['WALLETCONNECT_PROJECT_ID'],
),
'process.env.POSTHOG_KEY': JSON.stringify(
process.env['NEXT_PUBLIC_POSTHOG_KEY'],
),
'process.env.POSTHOG_HOST': JSON.stringify(
process.env['NEXT_PUBLIC_POSTHOG_HOST'],
),
'process.env.SENTRY_DSN': JSON.stringify(process.env['SENTRY_DSN']),
},
});