mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-21 15:41:57 +00:00
Fix the code to generate a proper ESM output
This commit is contained in:
parent
638ded2cd2
commit
766edb0be4
5 changed files with 17 additions and 9 deletions
|
|
@ -34,14 +34,20 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/pengx17/monaco-yaml/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": "^3.12.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"monaco-editor": "^0.16.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^23.3.10",
|
||||
"@types/node": "^10.9.3",
|
||||
"husky": "^1.2.1",
|
||||
"jest": "^23.6.0",
|
||||
"js-yaml": "^3.12.0",
|
||||
"jsonc-parser": "^2.0.2",
|
||||
"lint-staged": "^8.1.0",
|
||||
"monaco-editor": "^0.16.2",
|
||||
"monaco-editor-core": "0.15.5",
|
||||
"monaco-languages": "1.6.0",
|
||||
"monaco-plugin-helpers": "^1.0.2",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ helpers.packageESM({
|
|||
resolveAlias: {
|
||||
"vscode-nls": path.join(REPO_ROOT, "out/esm/fillers/vscode-nls.js")
|
||||
},
|
||||
resolveSkip: ["monaco-editor-core", "js-yaml"],
|
||||
resolveSkip: ["monaco-editor", "monaco-editor-core", "js-yaml"],
|
||||
destinationFolderSimplification: {
|
||||
node_modules: "_deps",
|
||||
"jsonc-parser/lib/esm": "jsonc-parser",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as mode from './yamlMode';
|
||||
import { setupMode } from './yamlMode';
|
||||
|
||||
import Emitter = monaco.Emitter;
|
||||
import IEvent = monaco.IEvent;
|
||||
|
|
@ -70,16 +70,13 @@ monaco.languages.yaml = createAPI();
|
|||
|
||||
// --- Registration to monaco editor ---
|
||||
|
||||
function withMode(callback: (module: typeof mode) => void): void {
|
||||
require<typeof mode>(['vs/language/yaml/yamlMode'], callback);
|
||||
}
|
||||
|
||||
monaco.languages.register({
|
||||
id: 'yaml',
|
||||
extensions: ['.yaml', '.yml'],
|
||||
aliases: ['YAML', 'yaml', 'YML', 'yml'],
|
||||
mimetypes: ['application/x-yaml'],
|
||||
});
|
||||
|
||||
monaco.languages.onLanguage('yaml', () => {
|
||||
withMode(mode => mode.setupMode(yamlDefaults));
|
||||
setupMode(yamlDefaults);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker';
|
||||
import * as worker from 'monaco-editor/esm/vs/editor/editor.worker';
|
||||
import { YAMLWorker } from './yamlWorker';
|
||||
|
||||
self.onmessage = () => {
|
||||
|
|
|
|||
|
|
@ -2811,6 +2811,11 @@ monaco-editor-core@0.15.5:
|
|||
resolved "https://registry.yarnpkg.com/monaco-editor-core/-/monaco-editor-core-0.15.5.tgz#145f1953a8e319282d92502252d68ef3486b6875"
|
||||
integrity sha512-kM3KHRjj16cFdK5Z0EppKUu793JVMpsEesBSWlqdgrxcmjyDMXV6xK0oatPcAYp3eOfbbyjPhruxDXj85FKyIg==
|
||||
|
||||
monaco-editor@^0.16.2:
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.16.2.tgz#950084ed82eeaef1c8c9d3c1bcab849fe11b2415"
|
||||
integrity sha512-NtGrFzf54jADe7qsWh3lazhS7Kj0XHkJUGBq9fA/Jbwc+sgVcyfsYF6z2AQ7hPqDC+JmdOt/OwFjBnRwqXtx6w==
|
||||
|
||||
monaco-languages@1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/monaco-languages/-/monaco-languages-1.6.0.tgz#54ec5510b31f3132939014f171ade235e84ef0bc"
|
||||
|
|
|
|||
Loading…
Reference in a new issue