microsoft / microsoft/TypeScript

Add an option to force source maps to use absolute paths?

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

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

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

説明

Previous related issue: https://github.com/Microsoft/TypeScript/issues/23180

It seems VS2017 is incompatible with relative paths, when debugging a UWP app now tries to load source maps from the app URI and the host does not support it.

'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/3.0)'. 
SourceMap ms-appx://6b826582-e42b-45b9-b4e6-dd210285d94b/js/require-config.js.map read failed: The URI prefix is not recognized..

Hard-coding the full path in tsconfig.json is not a good idea here, I hope we have an option to behave as 2.9.2 so that we can get the auto-resolved full path.

Edit: My tsconfig.json that works in TS2.9 but not in TS3.0:

{
  "compilerOptions": {
    "strict": true,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es2017",
    "outDir": "js/",
    "mapRoot": "js/",
    "sourceRoot": "sources/",
    "emitBOM": true,
    "module": "amd",
    "moduleResolution": "node"
  },
  "exclude": [
    "node_modules",
    "wwwroot"
  ]
}

My failed trial to fix this: (removed mapRoot and changed sourceRoot)

{
  "compilerOptions": {
    "strict": true,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es2017",
    "outDir": "js/",
    "sourceRoot": "../sources/",
    "emitBOM": true,
    "module": "amd",
    "moduleResolution": "node"
  },
  "exclude": [
    "node_modules",
    "wwwroot"
  ]
}

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

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

はじめの一歩

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

調査の方向性

まず関連する issue と報告された tsconfig の例を確認し、次に TypeScript が source map を出力し、mapRoot と sourceRoot を解決する仕組みを追跡します。報告された UWP デバッグケースについて、あるオプションで TypeScript 2.9.2 の絶対パスの動作を再現でき、関連する source-map 出力をカバレッジで網羅できれば完了です。

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

評価

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

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

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