Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Document the process of building assets for addons

Đang mở
#1,421 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github-actions, laravel, php, vite
Lĩnh vực
documentation

Hướng nghiên cứu

Start by locating the addon development documentation and checking how it currently explains frontend assets and release workflows. Document the two approaches in the issue: committing built assets and publishing them, or building assets in GitHub Actions and distributing them with a Composer update. The work is done when addon developers can follow the documentation to choose and use either approach.

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

Mô tả

This question has just come up on Discord:

Does anyone have any tips on how to distribute assets for an addon? I am developing an addon that needs some js and css on the frontend to work, I created frontend assets using vite but when used with the vite tag they only work for npm run build not dev

My response was:

You can either:

  1. Build them manually before you tag a release and include them in the Git repository. Then, in your service provider, you can publish the files to the site's public/vendor directory.
  2. A little more advanced way (which we do at Statamic, and I use for my addons), is to ignore committing assets to the repository, then building them as part of a GitHub Actions workflow used for releasing. Jason's built a package which'll then copy over the assets from the GitHub release into the site's vendor directory upon composer update.

It feels like we could do with some more detailed documentation around how addon developers should handle this.

Ngôn ngữ chính
PHP
Star
133
Fork
405
Merge trung bình
21 giờ 45 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/docs

Tất cả issue của statamic/docs

Issue tương tự

Thêm issue về PHP

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.