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

main.js ends up in Lazy loaded Chunks

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố với cấu hình styles được nêu trên Angular 18.1.4, sử dụng bundleName "main" và inject false, sau đó kiểm tra cách build phân loại các tệp được tạo. Được coi là hoàn tất khi xung đột tên được báo cáo dưới dạng cảnh báo và đầu ra lazy-chunk gây nhầm lẫn được xử lý.

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

Mô tả

area: @angular-devkit/build-angular devkit/build-angular:browser freq1: low severity2: inconvenient type: bug/fix
Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

setting the bundleName for one of the styles to "main" results in main.js end up in Lazy Loaded Chunks category
That also means the main.js doesn't have any hash at the end of it's filename.

      {
        "input": "styles/main.scss",
        "bundleName": "main",
        "inject": false
      },
Initial chunk files           | Names         |  Raw size | Estimated transfer size
polyfills.45732861e6a6851d.js | polyfills     |  34.19 kB |                11.03 kB

                              | Initial total |  34.19 kB |                11.03 kB

Lazy chunk files              | Names         |  Raw size | Estimated transfer size
main.css, main.js             | main          | 277.90 kB |                49.44 kB
runtime.a9fc7548b14f6ea7.js   | runtime       |   1.06 kB |               587 bytes

Proposed solution

Angular should report this collision as a warning. I spent hours figuring this out.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular: 18.1.4
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1801.4
@angular-devkit/build-angular 18.1.4
@angular-devkit/core 18.1.4
@angular-devkit/schematics 18.1.4
@schematics/angular 18.1.4
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.4

Anything else?

No response

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
16 giờ 35 phút
Pull request đã merge (30 ngày)
176

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.

Issue khác của angular/angular-cli

Tất cả issue của angular/angular-cli

Issue tương tự

Thêm issue về TypeScript

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.