Typescript
-
[Vite] 절대경로 설정프로그래밍/React 2024. 1. 3. 14:14
Vite + Typescript 를 사용한 프로젝트에서 절대경로를 설정하는 방법 tsconfg.json 과 vite.config.json 모두 고쳐줘야한다. >tsconfig.json { "compilerOptions": { "baseUrl": "src", ... "path": { "pages/*": ["pages/*"], "components/*": ["components/*"], } } 아래의 설정을 하지 않아서 경로를 제대로 찾지 못하는 에러가 발생했었음. import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; // https://vitejs.dev/config/ export default defineCon..
-
[Next.js] Jest + Typescript + Next.js프로그래밍/Next.js 2023. 12. 7. 11:37
개요 설치 및 적용 Get Started install) pnpm create next-app add dependencies) pnpm add -D @testing-library/jest-dom @testing-library/react @testing-library/user-event jest jest-environment-jsdom ts-jest script) // package.json "scripts": { ... "test": "jest", "test:watch": "jest --watchAll" }, jset config) // jest.config.js const nextJest = require('next/jest') const createJestConfig = nextJest({ dir: ..