Vite 환경에서 tsconfig Path 사용하기

라이브러리 설치

npm install vite-tsconfig-paths 
import react from "@vitejs/plugin-react";
import {defineConfig} from "vite";
import EnvironmentPlugin from "vite-plugin-environment";
import tsconfigPaths from "vite-tsconfig-paths";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
tsconfigPaths(),
],
resolve: {
alias: {},
},
build : {
outDir: "./build",
},
server : {
port: Number(process.env.PORT || 3000),
},
define : {},
});
Share