mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Adopt esbuild for monaco-languages
This commit is contained in:
parent
a50081289e
commit
0c394c0c7c
81 changed files with 987 additions and 102 deletions
|
|
@ -5,10 +5,21 @@
|
|||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
declare var AMD: any;
|
||||
declare var require: any;
|
||||
|
||||
registerLanguage({
|
||||
id: 'graphql',
|
||||
extensions: ['.graphql', '.gql'],
|
||||
aliases: ['GraphQL', 'graphql', 'gql'],
|
||||
mimetypes: ['application/graphql'],
|
||||
loader: () => import('./graphql')
|
||||
loader: () => {
|
||||
if (AMD) {
|
||||
return new Promise((resolve, reject) => {
|
||||
require(['vs/basic-languages/graphql/graphql'], resolve, reject);
|
||||
});
|
||||
} else {
|
||||
return import('./graphql');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue