moved mermaid feature to js bundle

This commit is contained in:
Aaron Qian 2022-11-11 13:35:40 -08:00 committed by Aaron Qian
parent 28fbd7d906
commit 55c400075c
No known key found for this signature in database
GPG key ID: BF1A987C395B5B0E
7 changed files with 16 additions and 16 deletions

View file

@ -0,0 +1,3 @@
if (process.env.FEATURE_FLOWCHART_MERMAID) {
import('./mermaid');
}

View file

@ -0,0 +1,7 @@
import mermaid from 'mermaid';
import * as params from '@params';
const mermaidOptions = params.flowchart?.mermaid || {};
const options = Object.assign({}, mermaidOptions, { startOnLoad: true });
mermaid.initialize(options);

View file

@ -9,3 +9,7 @@ if (process.env.FEATURE_TOC) {
if (process.env.FEATURE_DARKMODE) {
import('./darkmode');
}
if (process.env.FEATURE_FLOWCHART) {
import('./flowchart');
}

View file

@ -1,5 +1,5 @@
import Plyr from 'plyr';
import { videoplayer } from '@params';
import * as params from '@params';
const { plyr: options } = videoplayer;
const options = params.videoplayer?.plyr;
window.addEventListener('DOMContentLoaded', () => Plyr.setup('.js-player', options));