-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
31 lines (29 loc) · 1.09 KB
/
vite.config.js
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath, URL } from 'node:url';
const isProduction = !!(process.env.NODE_ENV && process.env.NODE_ENV === 'production');
const baseUrl = !isProduction ? '/' : `/`;
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 8080,
},
preview: {
port: 8081,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
'@layouts': fileURLToPath(new URL('./src/layouts', import.meta.url)),
'@views': fileURLToPath(new URL('./src/views', import.meta.url)),
'@router': fileURLToPath(new URL('./src/router', import.meta.url)),
'@store': fileURLToPath(new URL('./src/store', import.meta.url)),
'@scss': fileURLToPath(new URL('./src/scss', import.meta.url)),
'@utils': fileURLToPath(new URL('./src/utils', import.meta.url)),
'@api': fileURLToPath(new URL('./src/api', import.meta.url)),
},
},
base: baseUrl,
});