Plugin Loading #3098
Answered
by
hakimel
AhmedThahir
asked this question in
Q&A
Plugin Loading
#3098
-
|
Beta Was this translation helpful? Give feedback.
Answered by
hakimel
Dec 17, 2021
Replies: 1 comment
-
Yes, you can lazy or conditionally load plugins but you will need to call Here's an example: Reveal.initialize();
const loadScript = src => {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.onload = resolve;
script.onerror = reject;
script.src = src;
document.head.append(script);
})
}
loadScript( 'plugin/highlight/highlight.js' ).then(() => {
Reveal.registerPlugin( RevealHighlight )
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AhmedThahir
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you can lazy or conditionally load plugins but you will need to call
Reveal.registerPlugin
to register them.Here's an example: