update isWebExtension check in built script (fixes microsoft/vscode-internalbacklog#2295)
This commit is contained in:
parent
30d73ea6df
commit
51c39d0df3
|
@ -263,19 +263,38 @@ const webBuiltInExtensions: IBuiltInExtension[] = productJson.webBuiltInExtensio
|
||||||
|
|
||||||
type ExtensionKind = 'ui' | 'workspace' | 'web';
|
type ExtensionKind = 'ui' | 'workspace' | 'web';
|
||||||
interface IExtensionManifest {
|
interface IExtensionManifest {
|
||||||
main: string;
|
main?: string;
|
||||||
browser: string;
|
browser?: string;
|
||||||
extensionKind?: ExtensionKind | ExtensionKind[];
|
extensionKind?: ExtensionKind | ExtensionKind[];
|
||||||
|
extensionPack?: string[];
|
||||||
|
extensionDependencies?: string[];
|
||||||
|
contributes?: { [id: string]: any };
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Loosely based on `getExtensionKind` from `src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts`
|
* Loosely based on `getExtensionKind` from `src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts`
|
||||||
*/
|
*/
|
||||||
function isWebExtension(manifest: IExtensionManifest): boolean {
|
function isWebExtension(manifest: IExtensionManifest): boolean {
|
||||||
|
if (Boolean(manifest.browser)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (Boolean(manifest.main)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// neither browser nor main
|
||||||
if (typeof manifest.extensionKind !== 'undefined') {
|
if (typeof manifest.extensionKind !== 'undefined') {
|
||||||
const extensionKind = Array.isArray(manifest.extensionKind) ? manifest.extensionKind : [manifest.extensionKind];
|
const extensionKind = Array.isArray(manifest.extensionKind) ? manifest.extensionKind : [manifest.extensionKind];
|
||||||
return (extensionKind.indexOf('web') >= 0);
|
if (extensionKind.indexOf('web') >= 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (!Boolean(manifest.main) || Boolean(manifest.browser));
|
if (typeof manifest.contributes !== 'undefined') {
|
||||||
|
for (const id of ['debuggers', 'terminal', 'typescriptServerPlugins']) {
|
||||||
|
if (manifest.contributes.hasOwnProperty(id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function packageLocalExtensionsStream(forWeb: boolean): Stream {
|
export function packageLocalExtensionsStream(forWeb: boolean): Stream {
|
||||||
|
|
Loading…
Reference in a new issue