-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move svg icons to Blade partials #990
Move svg icons to Blade partials #990
Conversation
@ifox , can you, please, do a quick review? No need to merge it now, just to check the solution, because we are probably using this (as a fork) on a project on Vapor today, but if this implementation is not approved, we may be stuck with the fork forever, or we will have to get back to this to use a new implementation or do something different to get back to Twill 2.x. |
This solution looks good to me and I will approve and merge as soon as I can make sure this has no impact elsewhere. |
Awesome, thanks @ifox !! |
/build-frontend |
/build-frontend |
/build-frontend |
Problem
While trying to deploy a Twill app on Laravel Vapor we found an issue related to the icons, which are SVG stuffed directly into the HTML, at Blade compile time:
The problem is that Vapor deletes all files from the public directory (they are uploaded to S3 during deployment) and we don't see a way of telling it to not do it unless we fork the vapor-cli script and change it ourselves.
The current implementation of Twill expects the SVG files to be present on
/public
. Even if we overloadtwillAsset()
to load those files from a different directory (or on S3), Twill is still expecting them to be inside/public
, as per the snippet above.Description
This PR moves all
.svg
icon files to the folderviews/partials/icons
and import them as normal blade templates:I removed the creation of hashed (versioned) files, because blade files will be recompiled automatically by Laravel when they change.