Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Typescript declaration files gets built in incorrect directory

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu với các khai báo package.json và các entry point src/index.ts trong Projects A, B và C, sau đó kiểm tra cấu hình microbundle và TypeScript được sử dụng trong các package của Yarn workspace/Lerna. Tái hiện sự khác biệt trong đầu ra declaration và truy tìm lý do Project B ghi vào build/project-b/src/index.d.ts. Hoàn thành khi mọi package đều xuất declaration của mình tại đường dẫn build/index.d.ts đã cấu hình và các package downstream có thể resolve nó.

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

Mô tả

I have three projects, Project A, Project B, and Project C that looks something like this:

Project A

// package.json
{
  "main": "build/index.js",
  "module": "build/index.modern.js",
  "types": "build/index.d.ts",
  "source": "src/index.ts",
}

The project outputs the declaration file correctly inside build/index.d.ts

Project B

// package.json
{
  "main": "build/index.js",
  "module": "build/index.modern.js",
  "types": "build/index.d.ts",
  "source": "src/index.ts",
  "dependencies": {
    "@my-workspace/project-a": "^1.0.0",
  },
}

The project INCORRECTLY outputs the declaration file inside build/project-b/src/index.d.ts.

Project C

// package.json
{
  "main": "build/index.js",
  "module": "build/index.modern.js",
  "types": "build/index.d.ts",
  "source": "src/index.ts",
  "dependencies": {
    "@my-workspace/project-b": "^1.0.0",
  },
}

This project fails to build because it can't find the declaration file for @my-workspace/project-b.

Issue

In my actual project I have 12 packages in a yarn workspace / lerna environment. The issue randomly happens for some projects and not others even though they all have the same microbundle and typescript config setup.

Ngôn ngữ chính
JavaScript
Star
8.1k
Fork
358
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Issue khác của developit/microbundle

Tất cả issue của developit/microbundle

Issue tương tự

Thêm issue về JavaScript

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.