[TIL] jsconfig.json

Captainjack·2022년 1월 3일
0

TIL

목록 보기
122/258

jsconfig.json
프로젝트 최상의 폴더 옆에 위치해놓고
vscode의 파일 위치 설정 변경 가능


Visual Studio Code's JavaScript support can run in two different modes:

File Scope - no jsconfig.json: In this mode, JavaScript files opened in Visual Studio Code are treated as independent units. As long as a file a.js doesn't reference a file b.ts explicitly (either using import or CommonJS modules), there is no common project context between the two files.

Explicit Project - with jsconfig.json: A JavaScript project is defined via a jsconfig.json file. The presence of such a file in a directory indicates that the directory is the root of a JavaScript project. The file itself can optionally list the files belonging to the project, the files to be excluded from the project, as well as compiler options (see below).

The JavaScript experience is improved when you have a jsconfig.json file in your workspace that defines the project context. For this reason, we offer a hint to create a jsconfig.json file when you open a JavaScript file in a fresh workspace.


{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ],
      "@/*": [
        "./src/*"
      ],
    }
  },
  "exclude": [
    "node_modules",
    "dist"
  ]
}

출처

https://code.visualstudio.com/docs/languages/jsconfig

profile
til' CTF WIN

0개의 댓글