-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.ts
36 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
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import { svgrComponent } from 'vite-plugin-svgr-component';
import { version } from './package.json';
const APP_VERSION = process.env['APP_VERSION'] || `${version}+dev`;
const MICROSOFT_CLARITY_ID = process.env['MICROSOFT_CLARITY_ID'] || '';
const API_URL =
process.env['API_URL'] || 'http://substra-backend.org-1.com:8000';
// https://vitejs.dev/config/
export default defineConfig({
define: {
__APP_VERSION__: `'${APP_VERSION}'`,
...(process.env.NODE_ENV !== 'production'
? {
API_URL: `'${API_URL}'`,
MICROSOFT_CLARITY_ID: `'${MICROSOFT_CLARITY_ID}'`,
}
: {}),
DEFAULT_PAGE_SIZE: '30',
'process.env': {},
},
plugins: [react({ jsxImportSource: '@emotion/react' }), svgrComponent()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
host: 'substra-frontend.org-1.com',
},
});