Skip to content

Commit

Permalink
fix: fix global runtime crashes when bundling as an es6 module
Browse files Browse the repository at this point in the history
fixes #108
  • Loading branch information
b-kelly committed Apr 8, 2022
1 parent 07df8ef commit 1d2e7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/highlighting/hljs-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1d2e7f1

Please sign in to comment.