angular / angular/angular-cli

feature request: single assets in i18n builds

Open
#26,286 20 comments 26 reactions 0 assignees View on GitHub
devkit/build-angular:i18n feature feature: under consideration
Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
14h 23m
Merged PRs (30d)
162

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the build command and trace how assets are copied into each localized build. Compare the current per-locale output with the proposed root-level assets and locale symlinks; done means assets are not duplicated while absolute /assets URLs continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
build-system, localization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.