microsoft / microsoft/TypeScript

compilerOptions.paths to support relative and absolute paths

オープン
#10,688 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

TypeScript Version: 2.0.2

Code

{
  "compilerOptions": {
    "paths": {
      "./moment": ["node_modules/moment/moment.d.ts"],
      "/foo/bar/baz": [ "some/other/path/for/compiler"]
    }
  },

Expected behavior:
I expect (need) to be able to redirect the compiler for any module, not just 'non relative' paths. I'm deploying to a runtime environment that requires me to use relative or absolute paths, but I need the compiler to look to different locations when building locally.

Actual behavior:
The compiler seems to ignore any compilerOption.paths setting which starts with / or ./

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

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

はじめの一歩

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

調査の方向性

まず、提示された compilerOptions.paths 構成と相対・絶対モジュールキーを使って問題を再現します。コンパイラーの path-resolution のエントリーポイントを追跡し、これらのキーが無視される理由を特定します。相対パスと絶対パスが説明どおりにリダイレクトされ、既存の非相対パスの動作が維持されれば完了です。

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

評価

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

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

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