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
[Question][Plugins] Loading assets on demand? #2681
Comments
Here's one way I came up with in 30 seconds so use accordingly :-)
|
But how would this work alongside |
Put this plugin before prism so it runs first. |
I was hoping for a more robust way, but I guess I'll do that. I hope people will read the |
Well feel free to come up with your own way :-) |
The problem is not my specific use-case, it's the fact that plugins can override nodes that other plugins can depend on. Which can be a hassle to debug & even use by users, I understand that this is not an easy issue but maybe something to consider as an improvement in the future, if possible. |
Yes it's a poor design by Remark. Gatsby disallows plugins from mutating nodes for example for precisely this reason. |
I have a couple of more questions if you don't mind :)
This means I need to the plugin to be part of remark plugins because I'll need to manipulate the markdown AST right? Or there is another way to check for code blocks?
Not sure how can I load the assets from a plugin outside of As for point 3, I assume this needs to be done on the user side, or can it be done inside the plugin still? |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
I wrote
gatsby-plugin-klipse
but I'd love to load the scripts & style files on demand, only if the page requires them, so I wonder what is the best way to do this? or if there is another plugin that is already doing this so I can have a look?The text was updated successfully, but these errors were encountered: