Small tweaks

This commit is contained in:
Alex Dima 2020-09-18 21:23:26 +02:00
parent 577cfae1cf
commit 2a73aeb3a6
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0

View file

@ -76,7 +76,7 @@ interface IMonacoEditorWebpackPluginOpts {
languages?: EditorLanguage[]; languages?: EditorLanguage[];
/** /**
* customer languages which feature definition * Custom languages (outside of the ones shipped with the `monaco-editor`).
*/ */
customLanguages?: IFeatureDefinition[]; customLanguages?: IFeatureDefinition[];
@ -114,9 +114,10 @@ class MonacoEditorWebpackPlugin implements webpack.Plugin {
constructor(options: IMonacoEditorWebpackPluginOpts = {}) { constructor(options: IMonacoEditorWebpackPluginOpts = {}) {
const languages = options.languages || Object.keys(languagesById); const languages = options.languages || Object.keys(languagesById);
const customLanguages = options.customLanguages || [];
const features = getFeaturesIds(options.features || []); const features = getFeaturesIds(options.features || []);
this.options = { this.options = {
languages: coalesce(languages.map(id => languagesById[id])).concat(options.customLanguages || []), languages: coalesce(languages.map(id => languagesById[id])).concat(customLanguages),
features: coalesce(features.map(id => featuresById[id])), features: coalesce(features.map(id => featuresById[id])),
filename: options.filename || "[name].worker.js", filename: options.filename || "[name].worker.js",
publicPath: options.publicPath || '', publicPath: options.publicPath || '',