TypeStrong / TypeStrong/ts-loader

ES2015 module issue with transpileOnly + decorators + interfaces

Đang mở
#653 32 bình luận 26 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement help wanted pinned should be easy
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
439
Merge trung bình
17 giờ 17 phút
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với bản tái hiện độc lập gồm hai tệp tại github.com/RoystonS/ts-loader-issue và chạy bản build webpack của nó với transpileOnly được bật. Tái hiện lỗi bằng cách sử dụng các module ES2015, một class được trang trí và một interface được import từ một module cũng export một giá trị cụ thể; được xem là hoàn tất khi tổ hợp này biên dịch mà không có lỗi thiếu interface hoặc lỗi harmony-import.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript, webpack
Lĩnh vực
build-system, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.