mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 10:25:42 +01:00
Merge pull request #2853 from ValeraS/webpack-plugin
tune(monaco-editor-webpack-plugin): expose plugin options type
This commit is contained in:
commit
c9e1c9962b
1 changed files with 42 additions and 41 deletions
|
|
@ -99,6 +99,7 @@ function resolveDesiredLanguages(
|
|||
return coalesce(languages.map((id) => languagesById[id])).concat(userCustomLanguages || []);
|
||||
}
|
||||
|
||||
declare namespace MonacoEditorWebpackPlugin {
|
||||
interface IMonacoEditorWebpackPluginOpts {
|
||||
/**
|
||||
* Include only a subset of the languages supported.
|
||||
|
|
@ -145,7 +146,7 @@ interface IMonacoEditorWebpackPluginOpts {
|
|||
*/
|
||||
globalAPI?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
interface IInternalMonacoEditorWebpackPluginOpts {
|
||||
languages: IFeatureDefinition[];
|
||||
features: IFeatureDefinition[];
|
||||
|
|
@ -158,7 +159,7 @@ interface IInternalMonacoEditorWebpackPluginOpts {
|
|||
class MonacoEditorWebpackPlugin implements webpack.WebpackPluginInstance {
|
||||
private readonly options: IInternalMonacoEditorWebpackPluginOpts;
|
||||
|
||||
constructor(options: IMonacoEditorWebpackPluginOpts = {}) {
|
||||
constructor(options: MonacoEditorWebpackPlugin.IMonacoEditorWebpackPluginOpts = {}) {
|
||||
const monacoEditorPath = options.monacoEditorPath;
|
||||
const metadata = getEditorMetadata(monacoEditorPath);
|
||||
const languages = resolveDesiredLanguages(metadata, options.languages, options.customLanguages);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue