From 13a5ea3e06b23df636512e289773743b7377eca8 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Mon, 15 May 2023 17:14:15 +0300 Subject: [PATCH] Deferred run --- src/core/index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core/index.js b/src/core/index.js index 6e6164186..43db1eb15 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -4,5 +4,14 @@ import { Docsify } from './Docsify'; /** * Run Docsify */ -// eslint-disable-next-line no-unused-vars -documentReady(_ => new Docsify()); +const runDocsify = () => { + // eslint-disable-next-line no-unused-vars + documentReady(_ => new Docsify()); +}; + +if (window.DOCSIFY_DEFER) { + window.runDocsify = runDocsify; +} else { + window.runDocsify = () => {}; + runDocsify(); +}