File tree 1 file changed +39
-0
lines changed
packages/tsconfig-reference/copy/ko/options 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
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 안에서 긴 상대 경로를 피할 수 있습니다.
You can’t perform that action at this time.
0 commit comments