티스토리 뷰

Tool/Flow

[번역] Flow - Configuration

코딩산책 2018. 10. 23. 05:09

.flowconfig

How to configure Flow




Every Flow project contains a .flowconfig file. You can configure Flow by modifying .flowconfig. New projects or projects that are starting to use Flow can generate a default .flowconfig by running flow init.

모든 Flow 프로젝트는 .flowconfig 파일을 갖는다. .flowconfig를 수정함으로써 Flow 설정을 할 수 있다. 새로운 프로젝트 또는 Flow를 사용하기 시작한 프로젝트들은 기본적으로 flow init 함으로써 .flowconfig 파일을 생성할 수 있다.


.flowconfig format 

The .flowconfig uses a custom format that vaguely resembles INI files. We are not proud of our custom format and plan to support a better format in the future. GitHub issue #153 tracks this.

.flowconfig 사용은 INI 파일과 약간 비슷한 사용자 포맷을 사용한다. 우리는 사용자 포맷을 자랑스러워하지 않고 더 낳은 포맷을 지원할 계획이다. GitHub issue #153 tracks 이것.


The .flowconfig consists of 7 sections:


Comments 

Comment support was added in v0.23.0. Lines beginning with zero or more spaces followed by an # or ; or 💩are ignored. For example:

코멘트 지원은 v0.23.0에서  추가 되었다. 0(예제엔 없지만 zero도 먹는다) 또는 #, ;, 💩로 라인 시작이될때 무시되어 진다. 예를들어

# This is a comment
  # This is a comment
; This is a comment
  ; This is a comment
💩 This is a comment
  💩 This is a comment


Where to put the .flowconfig 

The location of the .flowconfig is significant. Flow treats the directory that contains the .flowconfig as the project root. By default Flow includes all the source code under the project root. The paths in the [include] section are relative to the project root. Some other configuration also lets you reference the project root via the macro<PROJECT_ROOT>.

.flowconfig 위치는 중요하다. Flow는 project root 디렉토리를 .flowconfig 가 있어야 디렉토리로 여긴다. 자연스럽게 Flow는 project root 디렉토리 안에 모든 소스코드를 포함한다. [include] 섹션의 경로들은 project root와 관련있다. 다른 설정은 또한 <PROJECT_ROOT> 매크로를 통해 project root를 참조할 수 있다.

Most people put the .flowconfig in the root of their project (i.e. next to the package.json). Some people put all their code in a src/ directory and therefore put the .flowconfig at src/.flowconfig.

대부분의 사람들은 .flowconfig를 그들의 프로젝트 루트에 놓는다(즉 package.json 옆에). 몇몇 사람들은 모든 코드를 src/ 안에 두다 그러므로 .flowconfig를 src/.flowconfig에 둔다.

Example 

Say you have the following directory structure, with your .flowconfig in mydir:

otherdir
└── src
    ├── othercode.js
mydir
├── .flowconfig
├── build
│   ├── first.js
│   └── shim.js
├── lib
│   └── flow
├── node_modules
│   └── es6-shim
└── src
    ├── first.js
    └── shim.js

Here is an example of how you could use the .flowconfig directives.

[include]
../otherdir/src

[ignore]
.*/build/.*

[libs]
./lib

Now flow will include a directory outside the .flowconfig path in its check, ignore the build directory and use the declarations in lib.

이제 flow는 .flowconfig 경로 외부의 디렉토리를 포함 할 것이다, build 디렉토리를 무시하고 lib 선언을 사용한다.


'Tool > Flow' 카테고리의 다른 글

[번역] Flow - Configuration[Option]_v0.83.0  (0) 2018.10.25
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함