Skip to content

Commit 23d5209

Browse files
Merge pull request #976 from dididy/translate-ko
translate paths to ko
2 parents b1ea14d + 4ce1677 commit 23d5209

File tree

1 file changed

+39
-0
lines changed
  • packages/tsconfig-reference/copy/ko/options

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
display: "Paths"
3+
oneline: "A set of locations to look for imports in"
4+
---
5+
6+
가져오기를 `baseUrl` 과 관련된 조회 위치로 다시 매핑하는 일련의 항목으로, [handbook](/docs/handbook/module-resolution.html#path-mapping)`paths` 의 더 많은 coverage가 수록되어 있습니다.
7+
8+
`paths` 를 사용하면 Typescript가 `require`/`import` 에서 가져오기를 해결하는 방법을 선언 할 수 있습니다.
9+
10+
```json tsconfig
11+
{
12+
"compilerOptions": {
13+
"baseUrl": ".", // 이 옵션은 반드시 "paths"가 명확할 때 지정해야 합니다.
14+
"paths": {
15+
"jquery": ["node_modules/jquery/dist/jquery"] // 이 매핑은 "baseUrl"에 상대적입니다.
16+
}
17+
}
18+
}
19+
```
20+
21+
이렇게하면`import "jquery"`를 작성할 수 있고 모든 올바른 입력을 로컬에서 얻을 수 있습니다.
22+
23+
```json tsconfig
24+
{
25+
"compilerOptions": {
26+
"baseUrl": "src",
27+
"paths": {
28+
"app/*": ["app/*"],
29+
"config/*": ["app/_config/*"],
30+
"environment/*": ["environments/*"],
31+
"shared/*": ["app/_shared/*"],
32+
"helpers/*": ["helpers/*"],
33+
"tests/*": ["tests/*"]
34+
},
35+
}
36+
```
37+
38+
이렇게 하면 TypeScript 파일 resolver가 많은 custom prefix로 코드를 찾을 수 있도록 지원할 수 있습니다.
39+
이 패턴을 사용하면 codebase 안에서 긴 상대 경로를 피할 수 있습니다.

0 commit comments

Comments
 (0)