angular / angular/angular-cli

feature request: single assets in i18n builds

Đang mở
#26,286 20 bình luận 26 reaction 0 người được giao Xem trên GitHub
devkit/build-angular:i18n feature feature: under consideration
Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
14 giờ 23 phút
Pull request đã merge (30 ngày)
162

Mô tả

### Command

build

### Description

Hi.
Currently angular just copy assets folder to every localized build. This leads to enormous dist size (in my case every locale with assets weigths 180MB, which can be multiplied by 15 locales).

### Describe the solution you'd like

My proposal is to put assets folder in root directory, instead of copying it inside every built locale, and symlink it inside every locale. This will give us better build times, and also will fix issues where developers use absolute urls to assets, eg:

```

```

My solution will give developers a way to use localized builds in mobile apps development (with capacitor for example; for now it’s strange to publish mobile app which weights over 2gb), better build times (no need to copy assets to every locale), better deploy times (transfer 180mb instead of 2.7GB)

### Describe alternatives you've considered

Currently, the only issue i encounter, is absolute path usage (described it in my example with img src). I make symlink to get this working:

/en/assets -> /assets

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

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

Hướng nghiên cứu

Bắt đầu với lệnh build và theo dõi cách các assets được sao chép vào từng build đã bản địa hóa. So sánh đầu ra hiện tại theo từng locale với các assets được đề xuất ở cấp root và các symlink của locale; hoàn tất khi các assets không bị trùng lặp và các URL /assets tuyệt đối vẫn tiếp tục hoạt động.

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

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
build-system, localization
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ 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.