angular / angular/angular-cli

Fonts are not resolved when using base href

Đang mở
#30,332 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
angular/build:application area: @angular/build area: docs
Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
14 giờ 23 phút
Pull request đã merge (30 ngày)
162

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh `build` với một font tùy chỉnh trong thư mục `public` và một base href đã được cấu hình. Theo dõi cách bản build của Angular CLI tạo URL của font, sau đó xác minh rằng đầu ra đã build phân giải nó bên dưới đường dẫn cơ sở thay vì tại thư mục gốc của site.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.