diff --git a/packages/plugin-dev/src/browser/hosted-plugin-manager-client.ts b/packages/plugin-dev/src/browser/hosted-plugin-manager-client.ts index af43366d63e38..5438f86eef013 100644 --- a/packages/plugin-dev/src/browser/hosted-plugin-manager-client.ts +++ b/packages/plugin-dev/src/browser/hosted-plugin-manager-client.ts @@ -181,10 +181,12 @@ export class HostedPluginManagerClient { async startDebugSessionManager(): Promise { let outFiles: string[] | undefined = undefined; - if (this.pluginLocation) { + if (this.pluginLocation && this.hostedPluginPreferences['hosted-plugin.launchOutFiles'].length > 0) { const fsPath = await this.fileService.fsPath(this.pluginLocation); if (fsPath) { - outFiles = [new Path(fsPath).join('**', '*.js').toString()]; + outFiles = this.hostedPluginPreferences['hosted-plugin.launchOutFiles'].map(outFile => + outFile.replace('${pluginPath}', new Path(fsPath).toString()) + ); } } await this.debugSessionManager.start({ diff --git a/packages/plugin-dev/src/browser/hosted-plugin-preferences.ts b/packages/plugin-dev/src/browser/hosted-plugin-preferences.ts index d7359288288d4..e4dd28efeeacd 100644 --- a/packages/plugin-dev/src/browser/hosted-plugin-preferences.ts +++ b/packages/plugin-dev/src/browser/hosted-plugin-preferences.ts @@ -30,6 +30,14 @@ export const HostedPluginConfigSchema: PreferenceSchema = { description: 'Using inspect or inspect-brk for Node.js debug', default: 'inspect', enum: ['inspect', 'inspect-brk'] + }, + 'hosted-plugin.launchOutFiles': { + type: 'array', + items: { + type: 'string' + }, + description: 'Array of glob patterns for locating generated JavaScript files (`${pluginPath}` will be replaced by plugin actual path).', + default: ['${pluginPath}/out/**/*.js'] } } }; @@ -37,6 +45,7 @@ export const HostedPluginConfigSchema: PreferenceSchema = { export interface HostedPluginConfiguration { 'hosted-plugin.watchMode': boolean; 'hosted-plugin.debugMode': string; + 'hosted-plugin.launchOutFiles': string[]; } export const HostedPluginPreferences = Symbol('HostedPluginPreferences');