-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (33 loc) · 1.08 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
import react from '@vitejs/plugin-react-swc';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import { generateScopedName, loadEnv } from './scripts/devUtils.js';
// import { sentryVitePlugin } from '@sentry/vite-plugin';
loadEnv();
// const isProd = process.env.NODE_ENV === 'production';
let config = defineConfig({
publicDir: 'server/public',
optimizeDeps: { exclude: ['@felixcatto/ui'] },
build: { sourcemap: true, outDir: 'dist/public' },
plugins: [
react(),
// isProd &&
// sentryVitePlugin({
// include: './dist/public',
// org: process.env.SENTRY_ORG,
// project: process.env.SENTRY_PROJECT,
// authToken: process.env.SENTRY_AUTH_TOKEN,
// }),
],
css: { modules: { generateScopedName } },
define: { __SENTRY_DEBUG__: false },
});
if (process.env.ANALYZE) {
const newPlugins = (config as any).plugins.concat({
...visualizer({ emitFile: true, open: true }),
enforce: 'post',
apply: 'build',
});
config = { ...config, plugins: newPlugins };
}
export default config;