vite.config.js

<aside> 💡 Vite supports using ES modules syntax in the config file

</aside>

→ even if the project is not using native Node ESM, e.g. type: "module"in package.json

Vite

절대 경로 설정

1. vite.config.ts 수동 설정

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';

// <https://vitejs.dev/config/>
export default defineConfig({
    plugins: [react()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },
});

2. **vite-tsconfig-paths 플러그인 사용하기**

https://github.com/aleclarson/vite-tsconfig-paths

Story Book