Skip to content

[Icons] Add a Command to Publish Icons to public/ for Production Builds #2849

Open
@oleg-andreyev

Description

@oleg-andreyev

Description

Summary

I opted to remove /assets as part of a Docker build optimization, considering it to be frontend source code rather than necessary runtime content.

However, this caused unexpected issues: the symfony/ux-icon package broke parts of the website, as it depends on persisted icon files that were no longer available.

Proposal

Introduce a Symfony console command, for example:

bin/console ux:icon:publish

This command would:
• Copy all resolved icon files (those from cache or selected for use) into a target public/ directory
• Pull icons directly from vendor/ sources (if package has icon, such as easyadmin-bundle)

It could also optionally:
• Accept a custom target directory (defaulting to something like public/icons/)
• Respect a manifest or internal mapping of icon usage

Use Case
• During Docker image build, I exclude /assets to slim down the image
• I forgot that ux-icon expects icons to exist in that path
• The result: broken icons and runtime errors in production
• A publish step (like ux:icon:publish) would fix this cleanly and predictably

Why This Matters
• Promotes clear separation between build-time and runtime assets
• Supports use cases where frontend source files are not shipped with the application (vendor)

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    IconsRFCRFC = Request For Comments (proposals about features that you want to be discussed)Status: Waiting FeedbackNeeds feedback from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions