File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,31 @@ function setAllValidations(
109109/** Load the Monaco editor. */
110110async function loadMonacoFromEsmCdn ( ) : Promise < Monaco > {
111111 let error = new Error ( ) ;
112- const urlList = [ "https://cdn.jsdelivr.net/npm/monaco-editor/+esm" ] ;
112+ const urlList = [
113+ {
114+ script : "https://cdn.jsdelivr.net/npm/monaco-editor/+esm" ,
115+ style : "https://cdn.jsdelivr.net/npm/monaco-editor/min/vs/style.min.css" ,
116+ } ,
117+ ] ;
113118
114119 if ( typeof monacoVersion !== "undefined" ) {
115- urlList . unshift (
116- `https://cdn.jsdelivr.net/npm/monaco-editor@${ monacoVersion } /+esm` ,
117- ) ;
120+ urlList . unshift ( {
121+ script : `https://cdn.jsdelivr.net/npm/monaco-editor@${ monacoVersion } /+esm` ,
122+ style : `https://cdn.jsdelivr.net/npm/monaco-editor@${
123+ monacoVersion
124+ } /min/vs/style.min.css`,
125+ } ) ;
118126 }
119127 for ( const url of urlList ) {
120128 try {
121- const result = await importFromCDN ( url ) ;
129+ const result = await importFromCDN ( url . script ) ;
130+
131+ if ( typeof document !== "undefined" ) {
132+ const link = document . createElement ( "link" ) ;
133+ link . rel = "stylesheet" ;
134+ link . href = url . style ;
135+ document . head . append ( link ) ;
136+ }
122137 return result as Monaco ;
123138 } catch ( e : unknown ) {
124139 // eslint-disable-next-line no-console -- OK
You can’t perform that action at this time.
0 commit comments