Comments (1)
would it be okay to add a build step like this to build-monaco-editor.ts:
/**
* Removes all code between REMOVE_IN_ESM_START and REMOVE_IN_ESM_END comments
*/
function ESM_removeRemoveInEsmCode(files: IFile[]) {
for (const file of files) {
let contents = file.contents.toString();
if (!/^\/[\/\*].*REMOVE_IN_ESM_START/m.test(contents)) {
continue;
}
contents = contents.replace(/^\/[\/\*].*REMOVE_IN_ESM_START[\s\S]*?\/[\/\*].*REMOVE_IN_ESM_END.*[\/\*]\/$/m, '')
file.contents = Buffer.from(contents);
}
}
and then add following comments to "editor.api.ts" in vscode:
/* REMOVE_IN_ESM_START (All code after this until the end marker is removed in ESM Code */
interface IMonacoEnvironment {
globalAPI?: boolean;
}
const monacoEnvironment: IMonacoEnvironment | undefined = (globalThis as any).MonacoEnvironment;
if (monacoEnvironment?.globalAPI || (typeof define === 'function' && (<any>define).amd)) {
globalThis.monaco = api;
}
if (typeof globalThis.require !== 'undefined' && typeof globalThis.require.config === 'function') {
globalThis.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'
]
});
}
/* REMOVE_IN_ESM_END */
from monaco-editor.
Related Issues (20)
- Reopen "Background color does not seems to be working on monaco.editor.defineTheme rules section." HOT 3
- [Bug] "Developer: Inspect Editor Tokens and Scopes" causes error HOT 1
- [Feature Request] Support for package.json conditional exports map, for extra libs typings acquisition HOT 1
- [Bug] d.classList is undefined
- [Bug] typescript type check HOT 1
- [Bug] Wrong cursor position if editor has `transform: scale(0.4);` HOT 1
- [Bug] Update Inlay Hints Provider Example to use `paddingRight` and `paddingLeft`
- [Feature Request] completionItems with insertText having quotes can have extra quotes in the front
- [Bug] paste by ctrl+v not working inside editor after update to 0.46.0 HOT 1
- [Bug] Glyph margin decorations/widgets for deleted lines not rendering in the inline view
- [Bug] createScopedLocalize is undefined HOT 1
- [Bug] Crash / Slowness when JSON Schema is applied
- [Bug] Can't automatic init webworker
- [Bug] Sticky scroll toggle does not work
- [Bug] Trying to fetch loader script get 403/421 cloudflare cdn link is probably broken HOT 8
- [Bug] Inline Completions doesn't respect word wrapping when rendering (ghost text) parts of an inline suggestion as additional lines (using view line)
- [Bug] toolbar background of inline completion is broken
- [Bug] simpleWorker.nls.js fails to load if vs path does not end in 'vs' HOT 1
- [Bug] Safari: non-https site reports `undefined is not an object (evaluating 'navigator.clipboard.write')`
- [Feature Request] Can we have a predicate to decide if a completion popup should be displayed?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monaco-editor.