diff --git a/build/azure-pipelines/common/installPlaywright.js b/build/azure-pipelines/common/installPlaywright.js new file mode 100644 index 00000000000..8321e71aab0 --- /dev/null +++ b/build/azure-pipelines/common/installPlaywright.js @@ -0,0 +1,14 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const retry_1 = require("./retry"); +const { installBrowsersWithProgressBar } = require('playwright/lib/install/installer'); +const playwrightPath = path.dirname(require.resolve('playwright')); +async function install() { + await retry_1.retry(() => installBrowsersWithProgressBar(playwrightPath)); +} +install(); diff --git a/build/azure-pipelines/common/installPlaywright.ts b/build/azure-pipelines/common/installPlaywright.ts new file mode 100644 index 00000000000..f0d821d44b8 --- /dev/null +++ b/build/azure-pipelines/common/installPlaywright.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as path from 'path'; +import { retry } from './retry'; +const { installBrowsersWithProgressBar } = require('playwright/lib/install/installer'); +const playwrightPath = path.dirname(require.resolve('playwright')); + +async function install() { + await retry(() => installBrowsersWithProgressBar(playwrightPath)); +} + +install(); diff --git a/package.json b/package.json index 2d4265c8142..072eba034f6 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "watch-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js watch-web", "eslint": "node build/eslint", "electron-rebuild": "electron-rebuild --arch=arm64 --force --version=11.2.0", - "playwright-install": "node node_modules/playwright/install.js", + "playwright-install": "node build/azure-pipelines/common/installPlaywright.js", "compile-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-build", "compile-extensions-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-extensions-build", "minify-vscode": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode",