Also generate features.ts from the monaco-editor npm module

This commit is contained in:
Alex Dima 2019-12-20 15:20:48 +01:00
parent 10a995c595
commit 6a5c30039f
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
4 changed files with 191 additions and 108 deletions

View file

@ -3,8 +3,8 @@ import * as webpack from 'webpack';
import * as loaderUtils from 'loader-utils';
import * as fs from 'fs';
import { AddWorkerEntryPointPlugin } from './plugins/AddWorkerEntryPointPlugin';
import { languagesById } from './languages';
import { featuresById } from './features';
import { languagesArr } from './languages';
import { featuresArr } from './features';
import { IFeatureDefinition } from './types';
const INCLUDE_LOADER_PATH = require.resolve('./loaders/include');
@ -18,6 +18,12 @@ const EDITOR_MODULE: IFeatureDefinition = {
},
};
const languagesById: { [language: string]: IFeatureDefinition; } = {};
languagesArr.forEach(language => languagesById[language.label] = language);
const featuresById: { [feature: string]: IFeatureDefinition; } = {};
featuresArr.forEach(feature => featuresById[feature.label] = feature);
/**
* Return a resolved path for a given Monaco file.
*/