Skip to content

Commit

Permalink
docs: Dynamically determine monaco version to preload the correct scr…
Browse files Browse the repository at this point in the history
…ipts
  • Loading branch information
ntucker committed Sep 16, 2023
1 parent d710a2d commit 3aa1fbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/src/components/Playground/MonacoPreloads.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { version } from 'monaco-editor/package.json';
import React, { memo } from 'react';

function MonacoPreloads() {
Expand All @@ -12,7 +13,7 @@ function MonacoPreloads() {
}
export default memo(MonacoPreloads);

export const MONACO_VERSION = '0.43.0';
export const MONACO_VERSION = version ?? '0.43.0';

const monacoPreloads = [
`https://cdn.jsdelivr.net/npm/monaco-editor@${MONACO_VERSION}/min/vs/editor/editor.main.js`,
Expand Down

0 comments on commit 3aa1fbb

Please sign in to comment.