mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
repairs esm and amd build (#4950)
This commit is contained in:
parent
f420968fc9
commit
e56ad4b588
43 changed files with 2302 additions and 856 deletions
16
src/common/initialize.ts
Normal file
16
src/common/initialize.ts
Normal 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);
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue