react_basic/vite.config.ts
2025-12-16 23:31:17 +09:00

40 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { fileURLToPath, URL } from 'url'
// https://vite.dev/config/
export default defineConfig({
server: {
host: true,
port: 5173,
allowedHosts: [
'react.sokuree.com',
]
},
plugins: [react()],
// Vite Path Aliases: import 경로를 src 기준의 절대경로(alias)로 설정
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
'@pages': fileURLToPath(new URL('./src/pages', import.meta.url)),
'@recoil': fileURLToPath(new URL('./src/recoil', import.meta.url)),
'@types': fileURLToPath(new URL('./src/types', import.meta.url)),
'@apis': fileURLToPath(new URL('./src/apis', import.meta.url)),
},
},
// SCSS 전역 설정
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "${fileURLToPath(
new URL('./src/assets/styles/main.scss', import.meta.url)
)}" as *;`,
},
},
},
})