mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +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
44
build/amd/src/editor.main.js
Normal file
44
build/amd/src/editor.main.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
self.MonacoEnvironment = {
|
||||
getWorker: function (_moduleId, label) {
|
||||
if (label === 'json') {
|
||||
return new Worker(new URL('../../../src/language/json/json.worker.ts', import.meta.url), {
|
||||
type: 'module'
|
||||
});
|
||||
}
|
||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||
return new Worker(new URL('../../../src/language/css/css.worker.ts', import.meta.url), {
|
||||
type: 'module'
|
||||
});
|
||||
}
|
||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||
return new Worker(new URL('../../../src/language/html/html.worker.ts', import.meta.url), {
|
||||
type: 'module'
|
||||
});
|
||||
}
|
||||
if (label === 'typescript' || label === 'javascript') {
|
||||
return new Worker(new URL('../../../src/language/typescript/ts.worker.ts', import.meta.url), {
|
||||
type: 'module'
|
||||
});
|
||||
}
|
||||
return new Worker(new URL('../../../src/editor/editor.worker.ts', import.meta.url), {
|
||||
type: 'module'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
import 'vs/nls.messages-loader!';
|
||||
import '../../../src/basic-languages/monaco.contribution';
|
||||
import '../../../src/language/css/monaco.contribution';
|
||||
import '../../../src/language/html/monaco.contribution';
|
||||
import '../../../src/language/json/monaco.contribution';
|
||||
import '../../../src/language/typescript/monaco.contribution';
|
||||
import * as require_ from 'require';
|
||||
|
||||
const styleSheetUrl = require_.toUrl('vs/style.css');
|
||||
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = styleSheetUrl;
|
||||
document.head.appendChild(link);
|
||||
|
||||
export * as m from 'monaco-editor-core';
|
||||
1368
build/amd/src/loader.js
Normal file
1368
build/amd/src/loader.js
Normal file
File diff suppressed because it is too large
Load diff
10
build/amd/src/nls.messages-loader.js
Normal file
10
build/amd/src/nls.messages-loader.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export function load(name, req, load, config) {
|
||||
const requestedLanguage = config['vs/nls']?.availableLanguages?.['*'];
|
||||
if (!requestedLanguage || requestedLanguage === 'en') {
|
||||
load({});
|
||||
} else {
|
||||
req([`vs/nls.messages.${requestedLanguage}`], () => {
|
||||
load({});
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue