-
tsconfig.json 설정Next.js 2023. 1. 10. 16:59728x90
tsconfig.json
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }
기본설정.
수정후
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true, "baseUrl": ".", "paths": { "@/components/*": ["components/*"], "@/ui/*": ["components/ui/*"], "@/screens/*": ["components/screens/*"], "@/hooks/*": ["hooks/*"], "@/shared/*": ["shared/*"], "@/config/*": ["config/*"], "@/services/*": ["services/*"], "@/utils/*": ["utils/*"], "@/store/*": ["store/*"], "@/assets/*": ["assets/*"] } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }
https://nextjs.org/docs/advanced-features/module-path-aliases
728x90'Next.js' 카테고리의 다른 글
[ERR]'AxiosHeaders | Partial<RawAxiosHeaders & MethodsHeaders & CommonHeaders>' 형식에 'Authorization' 속성이 없습니다.ts(7053) (0) 2023.01.16 Nextjs 보일러 프로젝트 생성 뼈대 (0) 2023.01.10 Nextjs에서 Nestjs로 accessToken header로 요청할때 오류 (0) 2022.12.26 Recoil, react-query 로그인 오류 (0) 2022.12.24 [Nextjs]SSG,SSR react-query로 Dynamic Routes에 적용 (0) 2022.12.22