mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Uses rollup for ESM build and d.ts bundling. (#5048)
* Uses rollup for ESM build and d.ts bundling.
Moves monaco.languages.{typescript, json, html, css} to monaco.*.
Moves monaco.editor.createWebWorker to monaco.createWebWorker.
* Adds excluded files from dist, as they needed to be patched.
This commit is contained in:
parent
0fd6f29a23
commit
5a7e917587
39 changed files with 1795 additions and 712 deletions
|
|
@ -1,6 +1,24 @@
|
|||
/// @ts-ignore
|
||||
import * as require from 'require';
|
||||
|
||||
if (typeof (globalThis as any).require !== 'undefined' && typeof (globalThis as any).require.config === 'function') {
|
||||
(globalThis as any).require.config({
|
||||
ignoreDuplicateModules: [
|
||||
'vscode-languageserver-types',
|
||||
'vscode-languageserver-types/main',
|
||||
'vscode-languageserver-textdocument',
|
||||
'vscode-languageserver-textdocument/main',
|
||||
'vscode-nls',
|
||||
'vscode-nls/vscode-nls',
|
||||
'jsonc-parser',
|
||||
'jsonc-parser/main',
|
||||
'vscode-uri',
|
||||
'vscode-uri/index',
|
||||
'vs/basic-languages/typescript/typescript'
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
self.MonacoEnvironment = {
|
||||
getWorker: function (_moduleId, label) {
|
||||
if (label === 'json') {
|
||||
|
|
@ -63,16 +81,10 @@ function getWorkerBootstrapUrl(workerScriptUrl: string | URL) {
|
|||
}
|
||||
|
||||
import 'vs/nls.messages-loader!';
|
||||
import * as monaco from '../../../src/editor/editor.main';
|
||||
export * from '../../../src/editor/editor.main';
|
||||
|
||||
// for now, lsp is only available to amd build
|
||||
import * as lsp from '@vscode/monaco-lsp-client';
|
||||
export { lsp };
|
||||
|
||||
// TODO@hediet get rid of the monaco global
|
||||
if ((globalThis as any).monaco) {
|
||||
(globalThis as any).monaco.lsp = lsp;
|
||||
}
|
||||
globalThis.monaco = monaco;
|
||||
|
||||
const styleSheetUrl = require.toUrl('vs/editor/editor.main.css');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue