-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripts: Download Puppeteer's Chromium binary on-demand #15667
Comments
A few notes here:
This topic was also discussed in Bugzilla in the chat related to Puppeteer upgrade in Gutenberg which unblocks testing with
|
Starting with #15712 we skip Chromium download in Travis by default. It should be revisited again once this issue is worked on. |
I opened this patch puppeteer/puppeteer#5325 against Puppeteer to explore some better ideas on how this could be solved on the @wordpress/scripts side. |
Started #20215 that uses the latest version of |
Currently, if a project defines
@wordpress/scripts
as a dependency, it establishes a transitive dependency onpuppeteer
such that installing thescripts
package requires the developer to download Puppeteer's Chromium binary. This can be a substantial download (80Mb+), and is often unnecessary depending upon whether the consuming project intends to use thescripts
module's end-to-end testing features.We should consider how to optimize this. One option may be to lazily download Puppeteer only when necessary, i.e. as part of the end-to-end scripts themselves.
This may require a few steps:
puppeteer
as an explicit dependencyoptionalDependencies
? Or not at all mentioned.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
environment variableImplementation notes:
There may be a module we could leverage for this purpose. Some brief searching yielded few results:
Or: Simply calling
npm install
as a synchronous subprocess in the script(s) itself.The text was updated successfully, but these errors were encountered: