Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Allow failing build if there are missing runtime assets

Abierto
#19,952 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
angular, typescript
Área
build-system

Línea de trabajo

Comienza con la configuración de assets en angular.json y sigue cómo el build de @angular/cli procesa las entradas de assets basadas en glob. Compara el comportamiento del array files solicitado con la opción alternativa failIfNoMatch; el trabajo estará terminado cuando los assets de runtime requeridos que falten hagan que el build falle, mientras se mantiene la compatibilidad con el uso existente de glob.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
27k
Forks
11.8k
Merge medio
16 h 35 min
PR fusionados (30 d)
176

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angular/angular-cli

Todos los issues de angular/angular-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.