mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(build): add --install watch flag for automatic browser install (#35639)
This commit is contained in:
parent
53abf161b0
commit
2ece112cb3
@ -63,6 +63,7 @@ const copyFiles = [];
|
|||||||
const watchMode = process.argv.slice(2).includes('--watch');
|
const watchMode = process.argv.slice(2).includes('--watch');
|
||||||
const lintMode = process.argv.slice(2).includes('--lint');
|
const lintMode = process.argv.slice(2).includes('--lint');
|
||||||
const withSourceMaps = process.argv.slice(2).includes('--sourcemap') || watchMode;
|
const withSourceMaps = process.argv.slice(2).includes('--sourcemap') || watchMode;
|
||||||
|
const installMode = process.argv.slice(2).includes('--install');
|
||||||
const ROOT = path.join(__dirname, '..', '..');
|
const ROOT = path.join(__dirname, '..', '..');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -405,6 +406,15 @@ onChanges.push({
|
|||||||
script: 'utils/generate_types/index.js',
|
script: 'utils/generate_types/index.js',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (installMode) {
|
||||||
|
// Keep browser installs up to date.
|
||||||
|
onChanges.push({
|
||||||
|
inputs: ['packages/playwright-core/browsers.json'],
|
||||||
|
command: 'npx',
|
||||||
|
args: ['playwright', 'install'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// The recorder and trace viewer have an app_icon.png that needs to be copied.
|
// The recorder and trace viewer have an app_icon.png that needs to be copied.
|
||||||
copyFiles.push({
|
copyFiles.push({
|
||||||
files: 'packages/playwright-core/src/server/chromium/*.png',
|
files: 'packages/playwright-core/src/server/chromium/*.png',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user