Proposal: Asset Budgets potentially w/ subtypes
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- angular, typescript, webpack
- Domaine
- build-system, cli
Piste de recherche
La demande cible les budgets de ng build dans la configuration de production et propose les sous-types asset:jpg, asset:svg et asset:png ; aucun fichier source ni test n’est identifié. Commencez par retracer la gestion existante des budgets utilisée par ng build, puis vérifiez que les assets dépassant la taille autorisée déclenchent les seuils d’avertissement et d’erreur configurés pour chaque sous-type.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Bug Report or Feature Request (mark with an x)
- [ ] bug report -> please search issues before submitting
- [x] feature request
Command (mark with an x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Mac High Sierra
MacBook-Pro:~ damien$ node --version
v8.9.4
MacBook-Pro:~ damien$ npm --version
5.6.0
MacBook-Pro:daffodil damien$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 7.1.0
Node: 8.9.4
OS: darwin x64
Angular: 7.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.10.7
@angular-devkit/build-angular 0.10.7
@angular-devkit/build-ng-packagr 0.10.7
@angular-devkit/build-optimizer 0.10.7
@angular-devkit/build-webpack 0.10.7
@angular-devkit/core 7.1.0
@angular-devkit/schematics 7.1.0
@angular/cdk 7.1.0
@angular/cli 7.1.0
@angular/pwa 0.11.3
@ngtools/json-schema 1.1.0
@ngtools/webpack 7.0.7
@schematics/angular 7.1.0
@schematics/update 0.11.0
ng-packagr 4.4.0
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
Repro steps
- Have bundle with 2mb budget
- Desire a budget that says all image assets are under 1mb.
- Create an asset that is 1.5mb
- Be unable to know that the asset outside of budget range as the "any" budget type will catch the bundle.
The log given by the failure
N/A
Desired functionality
I would like to set a budget specifically for image assets in my ng build. Ideally, I can configure this per image type (as each image type has different compressability.
e.g
{
...
"configurations": {
"production": {
...
budgets: [
{"type": "asset:jpg", "maximumWarning": "150kb", "maximumError": "300kb"},
{"type": "asset:svg", "maximumWarning": "15kb", "maximumError": "30kb"},
{"type": "asset:png", "maximumWarning": "150kb", "maximumError": "300kb"},
]
}
}
}
The use case here is automation around enforcing filesize requirements for assets to prevent absurd image sizes from being included. While "type": "any" meets this requirement, there are niches of asset types that should have stricter requirements (e.g. svg).
Mention any other details that might be useful
I'm trying to create budgets for the assets we use on the Daffodil project:
https://github.com/graycoreio/daffodil
Specifically, the PR in question:
https://github.com/graycoreio/daffodil/pull/171
- Langage dominant
- TypeScript
- Étoiles
- 27k
- Forks
- 11.8k
- Merge moyen
- 16 h 35 min
- PR mergées (30 j)
- 176
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Ouvertearea: @angular/build gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/angular-cli#33055 · 1 commentaire · 3 réactions ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Ouvertearea: @angular/build gemini-triaged
Difficulté 4/5 3-5 jours Accessibilité débutants 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 personne assignée ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 personne assignée ·
Toutes les issues de angular/angular-cli
Issues similaires
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
vicharanashala/fln#563 ·