-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
37 lines (36 loc) · 1.19 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
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import wasm from 'vite-plugin-wasm';
export default defineConfig(({ mode }) => {
const rootPath = mode === 'deploy' ? '/react-apps/' : '/';
return (
{
plugins: [
wasm(),
svgr({ exportAsDefault: true }),
react(),
],
base: rootPath,
resolve: {
alias: [
{ find: 'src', replacement: '/src' },
{ find: '@', replacement: '/src/wordLearner' },
{ find: 'M', replacement: '/src/monitors' },
{ find: 'A', replacement: '/src/answersToQuestions' },
],
},
esbuild: {
supported: {
'top-level-await': true,
},
},
define: {
__IS_DEV__: JSON.stringify(true),
__API__: JSON.stringify('http://localhost:8000'),
__PROJECT__: JSON.stringify('frontend'),
__ROOT_PATH__: JSON.stringify(rootPath),
},
}
);
});