TypeStrong / TypeStrong/ts-loader

ES2015 module issue with transpileOnly + decorators + interfaces

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

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

enhancement help wanted pinned should be easy
主要言語
TypeScript
スター
3.5k
フォーク
439
平均マージ
17時間 17分
マージ済み PR(30日)
2

説明

Hi there,

We have a very large Angular 2 codebase that we're attempting to move over to ts-loader; we're getting massive (4-5x) speed boosts compared to our existing awesome-typescript-loader setup, but sadly we're getting compilation issues when we turn on transpileOnly.

It only occurs when:

  • Building ES2015 modules AND
  • Using a class with a decorator on it AND
  • The class uses an imported interface AND
  • The imported interface comes from a module that also exports something concrete (e.g. a class or a const)

(webpack complains that it can't find the interface with a stack trace suggesting that it's processing harmony imports.)

I've created a repo with a standalone repro case in it: it's just tiny 2 files both of which are under 10 lines of code:

https://github.com/RoystonS/ts-loader-issue

(Is this related to what's discussed in issue #400?)

Thanks,
Royston.

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

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

はじめの一歩

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

調査の方向性

github.com/RoystonS/ts-loader-issue にあるスタンドアロンの2ファイル再現から始め、transpileOnly を有効にしてその webpack ビルドを実行します。ES2015 モジュール、デコレートされたクラス、および具体的な値もエクスポートするモジュールからインポートしたインターフェースを使って失敗を再現します。この組み合わせが missing-interface エラーや harmony-import エラーなしでコンパイルできれば完了です。

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

評価

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

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

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