fix(playground): work around lack of module support in mdbook

This commit is contained in:
Amaan Qureshi 2025-01-22 04:04:49 -05:00
parent 79244b5815
commit 3e72969ce4
3 changed files with 12 additions and 12 deletions

View file

@ -1,5 +1,3 @@
import { Parser, Language } from './tree-sitter.js';
function initializeLocalTheme() {
const themeToggle = document.getElementById('theme-toggle');
if (!themeToggle) return;
@ -62,7 +60,9 @@ function initializeCustomSelect({ initialValue = null, addListeners = false }) {
}
}
export async function initializePlayground(opts) {
window.initializePlayground = async (opts) => {
const { Parser, Language } = window.TreeSitter;
const { local } = opts;
if (local) {
initializeLocalTheme();