-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Translate tsconfig basic options about output directory into Japanese #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
orta
merged 4 commits into
microsoft:v2
from
Quramy:i18n-jp-tsconfig-in-out-directory-options
Feb 21, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
display: "Composite" | ||
oneline: "Used to create multiple build projects" | ||
--- | ||
|
||
`composite`オプションは、ビルドツール(`--build`モードでのTypeScript自体を含む) | ||
がプロジェクトがビルドされているかどうかを迅速に判断できるようにするために特定の制約を適用します。 | ||
|
||
この設定が有効なとき: | ||
|
||
- 明示的に設定されていない`rootDir`のデフォルト値は`tsconfig.json`ファイルを含むディレクトリとなります。 | ||
|
||
- すべての実装ファイルは、`include`パターンにマッチするか`files`リストに含まれなくてはなりません。この制約に違反した場合、`tsc`はどのファイルが指定されていないかを通知します。 | ||
|
||
- `declaration`のデフォルト値が`true`になります。 | ||
|
||
TypeScriptのプロジェクト機能についてのドキュメントは[ハンドブック](https://www.typescriptlang.org/docs/handbook/project-references.html)から参照できます。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
display: "Out Dir" | ||
oneline: "Set an output folder for all emitted files" | ||
--- | ||
|
||
設定すると、`.js`ファイル(`.d.ts`や`.js.map`ファイルも同様)がこのディレクトリ内に出力されます。 | ||
元のソースファイルのディレクトリ構造は保存されます。結果のルート構造が意図どおりでない場合は、[rootDir](#rootDir)を参照してください。 | ||
|
||
設定しない場合、`.js`ファイルは`.ts`ファイルを作成したのと同じディレクトリに出力されます。 | ||
|
||
```sh | ||
$ tsc | ||
|
||
example | ||
├── index.js | ||
└── index.ts | ||
``` | ||
|
||
次のような`tsconfig.json`の場合: | ||
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
} | ||
} | ||
``` | ||
|
||
この設定で`tsc`を実行すると、ファイルは指定された`dist`フォルダに生成されます。 | ||
|
||
```sh | ||
$ tsc | ||
|
||
example | ||
├── dist | ||
│ └── index.js | ||
├── index.ts | ||
└── tsconfig.json | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
display: "Out File" | ||
oneline: "Output a single file of all JS files concatenated" | ||
--- | ||
|
||
設定すると、すべての_グローバルな_(モジュールでない)ファイルは指定した単一の出力ファイルに結合されます。 | ||
|
||
もし`module`が`system`か`amd`の場合、この単一出力ファイルのグローバルなコンテンツの後ろにすべてのモジュールファイルも結合されます。 | ||
|
||
Note: `module`が`None`、`System`、`AMD`のいずれかでない限り、`outFile`は使用できません。 | ||
このオプションはCommonJSまたはES6 Modulesにバンドルする目的では使用_できません_。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
display: "Root Dir" | ||
oneline: "Sets the root folder within your source files" | ||
--- | ||
|
||
**デフォルト値**: 型定義ファイルでないすべての入力ファイルの中での最長の共通パス。`composite`が設定されている場合、この値の代わりに`tsconfig.json`を含むディレクトリがデフォルトとなります。 | ||
|
||
TypeScriptはファイルをコンパイルするとき、入力ディレクトリ内のディレクトリ構造が同じになるように出力ディレクト内の構造を保ちます。 | ||
|
||
例えば、いくつかの入力ファイルがあったとしましょう: | ||
|
||
``` | ||
MyProj | ||
├── tsconfig.json | ||
├── core | ||
│ ├── a.ts | ||
│ ├── b.ts | ||
│ ├── sub | ||
│ │ ├── c.ts | ||
├── types.d.ts | ||
``` | ||
|
||
推定される`rootDir`の値は、型定義ファイルでないすべての入力ファイルの中での最長の共通パス、この例では`core/`となります。 | ||
|
||
`outDir`が`dist`だったとすると、TypeScriptは次のツリー構造を出力します: | ||
|
||
``` | ||
MyProj | ||
├── dist | ||
│ ├── a.ts | ||
│ ├── b.ts | ||
│ ├── sub | ||
│ │ ├── c.ts | ||
``` | ||
|
||
ただし、出力ディレクトリ内に`core`を含めることを意図している場合があります。 | ||
`rootDir: "."`を`tsconfig.json`に設定すると、TypeScriptは次のツリー構造を出力します: | ||
|
||
``` | ||
MyProj | ||
├── dist | ||
│ ├── core | ||
│ │ ├── a.js | ||
│ │ ├── b.js | ||
│ │ ├── sub | ||
│ │ │ ├── c.js | ||
``` | ||
|
||
重要なこととして、`rootDir`は**どのファイルがコンパイルに含められるかに影響しません**。 | ||
`tsconfig.json`の`include`、`exclude`や`files`設定との相互作用はありません。 | ||
|
||
TypeScriptは`outDir`以外のディレクトリに出力ファイルを書き込むことはなく、ファイルの入力をスキップすることもありません。 | ||
このため、`rootDir`は出力する必要があるすべてのファイルがrootDirパスの下にあることを強制します。 | ||
|
||
例えば、次のツリー構造があったとしましょう: | ||
|
||
``` | ||
MyProj | ||
├── tsconfig.json | ||
├── core | ||
│ ├── a.ts | ||
│ ├── b.ts | ||
├── helpers.ts | ||
``` | ||
|
||
`rootDir`を`core`に、`include`を`*`に設定すると、`outDir`の_外部_(i.e. `../helpers.ts`)に出力する必要のあるファイル(`helpers.ts`)が生まれるため、エラーとなります。 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orta
I found nits typo in original doc and fix it.
(this character should be not
|
but│
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!