index.js 1.0 KB

1234567891011121314151617181920212223242526
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. import * as monaco from '../../../out/monaco-editor/esm/vs/editor/editor.main.js';
  6. self.MonacoEnvironment = {
  7. getWorkerUrl: function (moduleId, label) {
  8. if (label === 'json') {
  9. return './out/vs/language/json/json.worker.js';
  10. }
  11. if (label === 'css' || label === 'scss' || label === 'less') {
  12. return './out/vs/language/css/css.worker.js';
  13. }
  14. if (label === 'html' || label === 'handlebars' || label === 'razor') {
  15. return './out/vs/language/html/html.worker.js';
  16. }
  17. if (label === 'typescript' || label === 'javascript') {
  18. return './out/vs/language/typescript/ts.worker.js';
  19. }
  20. return './out/vs/editor/editor.worker.js';
  21. }
  22. };
  23. window.monacoAPI = monaco;