compileOptions - outDir, outFile, rootDir

Seulyi Yoo·2022년 7월 15일
0

TypeScript

목록 보기
30/42
post-thumbnail
{
	"outFile": {
    "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.",
    "type": "string",
    "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile"
  },
  "outDir": {
    "description": "Specify an output folder for all emitted files.",
    "type": "string",
    "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir"
  },
	"rootDir": {
    "description": "Specify the root folder within your source files.",
    "type": "string",
    "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir"
  },
}

// test.ts

console.log("Hello");

npx tsc

⇒ 최상위 경로에 test.js 생성!


// tsconfig.json

{
	"outDir": "./dist",
	"rootDir": "./src",
}
// src/test.ts

console.log("Hello");

npx tsc

⇒ dist/test.js 생성!


// tsconfig.json

{
	"outDir": "./dist",
	~~"rootDir": "./src",~~
}
// hello.ts
console.log("Hi");

npx tsc

⇒ dist/src/hello.js 생성!

profile
성장하는 개발자 유슬이 입니다!

0개의 댓글