Bundle required flags only #11
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, @frostney! How's it going?
I made some changes to your code to avoid bundling/importing all flags when using this component, and import only the required flags, to minimize bundle size.
I know it's been a while since you made this, but I'd be great if this gets released someday.
Basically, these changes allow importing flags beforehand and passing them using the
fromparam. To do that:from. This is not a path, it's an optional object that is intended to contain exported flags/images from the./flagssub-directories, like./flags,./flags/flat,./flags/shiny/16, etc. This doesn't affect previous versions.fromis not present. This might affect previous versions, but I don't think so.Hopefully these changes are understandable and easy to read. I added some examples in the
readmefile, and in the code too (just in case). If you need something else, please tell me. I'll be glad to help.Have a nice day, and thank you releasing this project!