@@ -28,14 +28,12 @@ import { useEffect, useState } from 'react';
28
28
import { useTranslations } from 'next-intl' ;
29
29
import { useRouter } from 'next/router' ;
30
30
import Script from 'next/script' ;
31
- import useMonacoVersion , { defaultMonacoVersion } from './monacoversion.js' ;
32
31
import Select from './ui/select.js' ;
33
32
34
33
const Builder = ( ) => {
35
34
const translate = useTranslations ( ) ;
36
35
const router = useRouter ( ) ;
37
36
38
- const monaco_version = useMonacoVersion ( router . asPath ) || defaultMonacoVersion ;
39
37
const randomType = [ "redirect" , "compress" , "docs" ] ;
40
38
41
39
return (
@@ -66,18 +64,18 @@ const Builder = () => {
66
64
const path = parsedUrl.pathname;
67
65
68
66
if (path.startsWith('/vs')) {
69
- const newPath = \`/third-party/monaco-editor/${ monaco_version } / package/min\${path}\`;
67
+ const newPath = \`/third-party/monaco-editor/package/min\${path}\`;
70
68
return originalFetch(newPath, init);
71
69
}
72
70
} catch (e) {
73
71
if (url.startsWith('vs')) {
74
- const newPath = \`/third-party/monaco-editor/${ monaco_version } / package/min/\${url}\`;
72
+ const newPath = \`/third-party/monaco-editor/package/min/\${url}\`;
75
73
return originalFetch(newPath, init);
76
74
} else if (url.startsWith('/vs')) {
77
- const newPath = \`/third-party/monaco-editor/${ monaco_version } / package/min\${url}\`;
75
+ const newPath = \`/third-party/monaco-editor/package/min\${url}\`;
78
76
return originalFetch(newPath, init);
79
77
} else if (url.startsWith('../../../vs')) {
80
- const newPath = \`/third-party/monaco-editor/${ monaco_version } / package/min\${url.slice(8)}\`;
78
+ const newPath = \`/third-party/monaco-editor/package/min\${url.slice(8)}\`;
81
79
return originalFetch(newPath, init);
82
80
} else {
83
81
return originalFetch(input, init);
@@ -88,9 +86,8 @@ const Builder = () => {
88
86
};
89
87
` }
90
88
</ Script >
91
- < script src = { `/third-party/monaco-editor/${ monaco_version } /package/min/vs/loader.js` } > </ script >
92
- < script src = { `/third-party/monaco-editor/${ monaco_version } /package/min/vs/editor/editor.main.nls.js` } > </ script >
93
- < script src = { `/third-party/monaco-editor/${ monaco_version } /package/min/vs/editor/editor.main.js` } > </ script >
89
+ < script src = "/third-party/monaco-editor/package/min/vs/loader.js" > </ script >
90
+ < script src = "/third-party/monaco-editor/package/min/vs/editor/editor.main.js" > </ script >
94
91
< Script id = "builder" strategy = "afterInteractive" >
95
92
{ `
96
93
var h_div = document.getElementById('monaco');
0 commit comments