From 1d2e7f137d0c527d7cd6bedf87c819c7ad97ad0c Mon Sep 17 00:00:00 2001 From: b-kelly Date: Fri, 8 Apr 2022 13:55:14 -0400 Subject: [PATCH] fix: fix `global` runtime crashes when bundling as an es6 module fixes #108 --- src/shared/highlighting/hljs-instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/highlighting/hljs-instance.ts b/src/shared/highlighting/hljs-instance.ts index 77372558..bbc21471 100644 --- a/src/shared/highlighting/hljs-instance.ts +++ b/src/shared/highlighting/hljs-instance.ts @@ -10,7 +10,7 @@ import type { HLJSApi } from "highlight.js"; /** Attempts to get the optional highlight.js instance */ export function getHljsInstance(): HLJSApi { // @ts-expect-error - let hljs: HLJSApi = global.hljs as HLJSApi; + let hljs: HLJSApi = globalThis.hljs as HLJSApi; if (!hljs) { try {