angular / angular/angular-cli

feature request: single assets in i18n builds

未關閉
#26,286 20 則留言 26 個 reaction 已指派 0 人 在 GitHub 檢視
devkit/build-angular:i18n feature feature: under consideration
主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
14 小時 23 分鐘
30 天內合併 PR
162

描述

### 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

貢獻指南

開啟貢獻指南

研究方向

從建置命令開始,追蹤 assets 如何複製到每個在地化建置中。將目前按 locale 產生的輸出與提議的根層級 assets 和 locale symlink 進行比較;當 assets 不再重複,且絕對 /assets URL 繼續正常運作時,即視為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
build-system, localization
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。