angular / angular/angular-cli

Fonts are not resolved when using base href

Ouverte
#30,332 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
angular/build:application area: @angular/build area: docs
Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
14 h 23 min
PR mergées (30 j)
162

Description

### Command

build

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

I'm trying to deploy an Angular application to GitHub Pages using GitHub Actions. I've set the base href correctly, but the sources aren't showing up. The routes to get the sources ignore the base href. I've also tried specifying the deploy-url, but I get the same result.

### Minimal Reproduction

1. Create a project.
2. Add a custom font that's in the public folder.

![Image](https://github.com/user-attachments/assets/3c1d5e3d-e896-4fd6-830c-e5db839c1ab3)

3. Build the project with a base href and deploy it.
4. Note that the font URL ignores the base href.

### Exception or Error

```text

```

### Your Environment

```text
Angular CLI: 19.1.7
Node: 22.14.0
Package Manager: npm 10.9.2
OS: win32 x64

Angular:
...

Package Version
------------------------------------------------------
@angular-devkit/architect 0.1901.7 (cli-only)
@angular-devkit/core 19.1.7 (cli-only)
@angular-devkit/schematics 19.1.7 (cli-only)
@schematics/angular 19.1.7 (cli-only)
```

### Anything else relevant?

_No response_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire la commande `build` avec une police personnalisée dans le dossier `public` et un base href configuré. Suivez la manière dont le build d’Angular CLI génère l’URL de la police, puis vérifiez que la sortie générée la résout sous le chemin de base plutôt qu’à la racine du site.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
build-system
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.