tsconfig.json
ํ์ผ ์์ฑ$ touch tsconfig.json
npm run dev
๋๋ yarn dev
)๋ฅผ ์คํํ๋ฉด Next.js๊ฐ ํ์ํ ํจํค์ง ์ค์น ๊ณผ์ ์ ์๋ดํ๋ฉฐ ์ค์ ์ ์๋ฃ$ yarn dev
# You'll see instructions like these:
#
# Please install TypeScript, @types/react, and @types/node by running:
#
# yarn add --dev typescript @types/react @types/node
#
# ...
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
.js
ํ์ผ์ .tsx
๋๋ .ts
๋ก ๋ณ๊ฒฝํ๊ณ , TypeScript๋ฅผ ์ ์ฉ์ฐธ๊ณ
์์ ๋ฉ์ ธ์~