-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
35 lines (32 loc) · 877 Bytes
/
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
import {defineConfig, loadEnv} from 'vite';
import react from '@vitejs/plugin-react-swc';
import svgr from 'vite-plugin-svgr';
interface ConfigInput {
mode: string;
}
// https://vitejs.dev/config/
export default ({mode}: ConfigInput) => {
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
return defineConfig({
plugins: [react(), svgr()],
base: '/' + process.env.VITE_BASE_URL,
server: {
host: '0.0.0.0',
},
resolve: {
alias: {
src: '/src/',
components: '/src/components',
contexts: '/src/contexts',
hooks: '/src/hooks',
routes: '/src/routes',
api: '/src/api',
assets: '/src/assets',
images: '/src/assets/images',
icons: '/src/assets/icons',
styles: '/src/assets/styles',
constants: '/src/assets/constants',
},
},
});
};