From 3aa1fbb307f294ff334bb2325f49a46189550432 Mon Sep 17 00:00:00 2001 From: Nathaniel Tucker Date: Fri, 15 Sep 2023 20:45:49 -0500 Subject: [PATCH] docs: Dynamically determine monaco version to preload the correct scripts --- website/src/components/Playground/MonacoPreloads.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/components/Playground/MonacoPreloads.tsx b/website/src/components/Playground/MonacoPreloads.tsx index 33c1ed1f834e..0bf025426b05 100644 --- a/website/src/components/Playground/MonacoPreloads.tsx +++ b/website/src/components/Playground/MonacoPreloads.tsx @@ -1,3 +1,4 @@ +import { version } from 'monaco-editor/package.json'; import React, { memo } from 'react'; function MonacoPreloads() { @@ -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`,