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
Best practices: "Writing Yew component libraries which include assets" #2823
Comments
The easiest for now, is to have most your resources in a separately bundled part of the project, if |
I guess a I think I'll give this some more thought once I've tried writing one such library crate so I can give a better rundown of the shape of a tutorial which might have helped. |
|
I've used the trunk hooks for assets, here is an example: But if there is a better/easier way, I'd be happy. |
This is about:
Problem
While there are lots of examples, including from the Yew project itself, for writing components in a library crate; there are few, or no, examples which show how to bundle additional assets in with the component library.
I appreciate that Yew is meant to be non-"partisan" when it comes to bundling technologies; but it would seem that
trunk
has won most of the argument. However, when looking throughtrunk
's documentation, I could not find anything about assets from dependencies either.I am looking to wrapper a number of JS libraries as part of my next project, and while I could wrapper them all in my application crate, thereby bypassing the problem because all the JS and CSS will end up referenced in my top level
index.html
, I would prefer to write some component library crates and have them easily consumed by other application authors as well.Details about the solution you'd like
It would be great if, alongside the tutorial which currently exists, there were out-links to exemplary crates doing this kind of thing, or even better, a tutorial about doing it at the level of the tutorial which exists already.
Questionaire (Optional)
The text was updated successfully, but these errors were encountered: