Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Allow failing build if there are missing runtime assets

Offen
#19,952 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
build-system

Rechercherichtung

Beginne mit der Assets-Konfiguration in angular.json und verfolge, wie der Build von @angular/cli Asset-Einträge auf Basis von Globs verarbeitet. Vergleiche das Verhalten des angeforderten files-Arrays mit der alternativen failIfNoMatch-Option; abgeschlossen ist die Aufgabe, wenn fehlende erforderliche Laufzeit-Assets dazu führen, dass der Build fehlschlägt, während die bestehende Verwendung von Globs weiterhin unterstützt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area: @angular-devkit/build-angular feature feature: insufficient votes

🚀 feature request

Relevant Package

This feature request is for @angular/cli

Description

If you have in the assets configuration in angular.json:

    "assets": [
        ...
        {
            "glob": "jquery.min.js",
            "input": "./node_modules/jquery/dist",
            "output": "/assets/jquery"
        },
        ...
    ]

And the glob doesn't match anything, no error is generated. This means the build can be broken because the assets folder doesn't contain all required runtime assets, but we won't realize until runtime.

Describe the solution you'd like

The feature request is to add an array field files that can be used instead of glob to tell exactly which files to copy: `"files":

    "assets": [
        ...
        {
            "files": ["jquery.min.js", "jquery.min.map"],
            "input": "./node_modules/jquery/dist",
            "output": "/assets/jquery"
        },
        ...
    ]
Describe alternatives you've considered

I considered listing the jquery.min.js file in the scripts section of angular.json, but this solution doesn't work perfectly for cases when it's not a "js" file I want in the assets folder. For example, mapbox comes with a folder with images, that I need copied to the assets folder.

An alternatively feature implementation I considered recommending was you could add an option failIfNoMatch to make the build fail if the glob doesn't match anything: "failIfNoMatch": true. But this solution is not as useful as the files one though, as the glob jquery.min.{js,map} would succeed even if it finds only one of the required files.

Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
16 Std. 35 Min.
Gemergte PRs (30 T.)
176

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus angular/angular-cli

Alle Issues in angular/angular-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.