Add support for fully-qualified Monaco base URL (e.g. when using unpkg)
This commit is contained in:
parent
f8ee1f8847
commit
a94ccf8b71
|
|
@ -12,7 +12,7 @@ export function initializeMonacoWorker(libPath?: string) {
|
|||
return;
|
||||
|
||||
const origin = document.location.origin;
|
||||
const baseUrl = `${origin}/${libPath}`;
|
||||
const baseUrl = libPath.startsWith('http') ? libPath : `${origin}/${libPath}`;
|
||||
|
||||
require.config({paths: {'vs': `${baseUrl}/vs`}});
|
||||
win.MonacoEnvironment = {getWorkerUrl: () => proxy};
|
||||
|
|
|
|||
Loading…
Reference in a new issue