mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Export custom TypeScript worker variables
A custom TypeScript worker factory function gets passed `TypeScriptWorker`, `ts`, and `libFileMap`. It also exports `create` using ESM. However, this can’t be used, because the custom worker factory is only called if a custom worker path is defined. Exposing these members, means a worker can be defined using ESM.
This commit is contained in:
parent
212670ceb4
commit
681b38140f
1 changed files with 6 additions and 4 deletions
|
|
@ -3,15 +3,17 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as edworker from 'monaco-editor-core/esm/vs/editor/editor.worker';
|
||||
import { ICreateData, create } from './tsWorker';
|
||||
import { initialize } from 'monaco-editor-core/esm/vs/editor/editor.worker';
|
||||
import * as ts from './lib/typescriptServices';
|
||||
import { ICreateData, TypeScriptWorker, create } from './tsWorker';
|
||||
import { worker } from '../../fillers/monaco-editor-core';
|
||||
import { libFileMap } from './lib/lib';
|
||||
|
||||
self.onmessage = () => {
|
||||
// ignore the first message
|
||||
edworker.initialize((ctx: worker.IWorkerContext, createData: ICreateData) => {
|
||||
initialize((ctx: worker.IWorkerContext, createData: ICreateData) => {
|
||||
return create(ctx, createData);
|
||||
});
|
||||
};
|
||||
|
||||
export { create } from './tsWorker';
|
||||
export { TypeScriptWorker, create, initialize, libFileMap, ts };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue