repairs esm and amd build (#4950)

This commit is contained in:
Henning Dieterichs 2025-08-28 13:35:17 +02:00 committed by GitHub
parent f420968fc9
commit e56ad4b588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 2302 additions and 856 deletions

16
src/common/initialize.ts Normal file
View file

@ -0,0 +1,16 @@
import * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker.start';
let initialized = false;
export function isWorkerInitialized(): boolean {
return initialized;
}
export function initialize(callback: (ctx: any, createData: any) => any): void {
initialized = true;
self.onmessage = (m) => {
worker.start((ctx) => {
return callback(ctx, m.data);
});
};
}