|
|
|
@ -31,7 +31,11 @@ function resolveMonacoPath(filePath: string): string {
|
|
|
|
|
try {
|
|
|
|
|
return require.resolve(path.join('monaco-editor/esm', filePath));
|
|
|
|
|
} catch(err) {
|
|
|
|
|
try {
|
|
|
|
|
return require.resolve(path.join(process.cwd(), 'node_modules/monaco-editor/esm', filePath));
|
|
|
|
|
} catch(err){
|
|
|
|
|
return require.resolve(filePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,6 +75,11 @@ interface IMonacoEditorWebpackPluginOpts {
|
|
|
|
|
*/
|
|
|
|
|
languages?: EditorLanguage[];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* customer languages which feature definition
|
|
|
|
|
*/
|
|
|
|
|
customLanguages?: IFeatureDefinition[];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Include only a subset of the editor features.
|
|
|
|
|
* Use e.g. '!contextmenu' to exclude a certain feature.
|
|
|
|
@ -107,7 +116,7 @@ class MonacoEditorWebpackPlugin implements webpack.Plugin {
|
|
|
|
|
const languages = options.languages || Object.keys(languagesById);
|
|
|
|
|
const features = getFeaturesIds(options.features || []);
|
|
|
|
|
this.options = {
|
|
|
|
|
languages: coalesce(languages.map(id => languagesById[id])),
|
|
|
|
|
languages: coalesce(languages.map(id => languagesById[id])).concat(options.customLanguages || []),
|
|
|
|
|
features: coalesce(features.map(id => featuresById[id])),
|
|
|
|
|
filename: options.filename || "[name].worker.js",
|
|
|
|
|
publicPath: options.publicPath || '',
|
|
|
|
|