-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
33 lines (30 loc) · 1.07 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
32
33
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path, { dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [react()],
build: {
outDir: 'dist', // Output directory
sourcemap: true, // Generate source maps for debugging
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'), // For imports like '@/components/...'
'@components': path.resolve(__dirname, './src/components'), // For imports like '@components/...'
'@pages': path.resolve(__dirname, './src/pages'), // For imports like '@pages/...'
'@helpers': path.resolve(__dirname, './src/helpers'), // For utility functions
'@assets': path.resolve(__dirname, './src/assets'), // For static files
'@styles': path.resolve(__dirname, './src/styles'), // For CSS/SCSS files
},
},
server: {
port: 3000, // Dev server port
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './tests/setup.js',
},
});