Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

change: load monaco from cdn (#1551)

bautistaaa250dbf68a093
diff --git a/packages/monaco/src/code-editor.tsx b/packages/monaco/src/code-editor.tsx
index 64a48f0c..b86361ca 100644
--- a/packages/monaco/src/code-editor.tsx
+++ b/packages/monaco/src/code-editor.tsx
@@ -5,24 +5,9 @@ import { useTheme } from 'next-themes';
import { useMemo } from 'react';
import { useEditorSettingsStore } from './settings-store';
-const ADMIN_HOST = 'admin.typehero.dev';
-const getBaseUrl = () => {
- if (typeof globalThis.window === 'undefined') return '';
- const isProd = process.env.NODE_ENV === 'production';
- if (isProd && window?.location?.hostname === ADMIN_HOST) {
- return 'https://typehero.dev';
- }
-
- if (!isProd && window?.location?.port === '3001') {
- return 'http://localhost:3000';
- }
-
- return '';
-};
-
loader.config({
paths: {
- vs: `${getBaseUrl()}/min/vs`,
+ vs: `https://playgroundcdn.typescriptlang.org/cdn/5.5.4/monaco/min/vs`,
},
});