error TS5053: Option 'declarationDir' cannot be specified with option 'outFile'.

オープン
#12,405 コメント 0 件 リアクション 16 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
compilers

調査の方向性

まず、示されている tsconfig.json とコンパイラオプション outFile、declaration、declarationDir を使って TS5053 診断を再現します。このオプションの組み合わせがどこで拒否されるのかを追跡し、宣言出力に関連するテストまたはエントリポイントを特定します。宣言を別のディレクトリに出力でき、バンドルされた JavaScript 出力が変更されない状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Help Wanted Suggestion

Attempting to change the declaration file output directory, I get the following error:

error TS5053: Option 'declarationDir' cannot be specified with option 'outFile'.

tsconfig.json looks like this:

{
    "$schema": "http://json.schemastore.org/tsconfig",
    "compilerOptions": {
        "module": "amd",
        "target": "es6",
        "outFile": "../assets/js/main.js",
        "sourceMap": true,
        "declaration": true,
        "declarationDir": "../"
    }
}

I want my .d.ts file emitted somewhere else, since that's not a public asset.

Why is this not permitted?

I'm forced to create two (near-identical) tsconfig files and run the compiler twice to get the declaration file and output file. What for?

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 15時間
マージ済み PR(30日)
106

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。