-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add public API #20
Add public API #20
Conversation
@@ -54,6 +57,11 @@ export function viteSvgToWebfont<T extends GeneratedFontTypes = GeneratedFontTyp | |||
return { | |||
name: 'vite-svg-2-webfont', | |||
enforce: 'pre', | |||
api: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I was unable to find any docs about this, could you share some docs about how this works and where it can be used?
Also, care to document this in the README
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Here's the docs: https://rollupjs.org/plugin-development/#direct-plugin-communication
I'll update the readme a little bit later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reference!
I'd be happy to merge once there is some readme
about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'll plan to update the readme tomorrow. Sorry for the delay :(
- **description** | ||
- `type` - a font format generated by a plugin | ||
- `href` - a path to a generated font | ||
- [This repo](https://github.com/stryaponoff/vite-plugin-preload-webfont) contains the usage example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to find a best way to provide an example of how it works without adding a big code examples to the README.md and without duplicating your ./example dir so I just made another repo with plugin example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works IMHO 🙂
- **description** | ||
- `type` - a font format generated by a plugin | ||
- `href` - a path to a generated font | ||
- [This repo](https://github.com/stryaponoff/vite-plugin-preload-webfont) contains the usage example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works IMHO 🙂
Co-authored-by: Chemi Atlow <[email protected]>
I was needed to add generated fonts to the
<link rel="preload" />
. Firstly, I was thinking about add this functionality to your plugin but then I decided that the public API is a better option and implemented it along with a custom plugin for my needs that rely on your plugin.