fix: add missing npm config environment variable (#8996)

PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM can now also be specified from npm config by using it's lowercase variant
This commit is contained in:
Dhiraj Gagrai 2022-09-22 13:16:11 +05:30 committed by GitHub
parent 37417b1dce
commit 7c1be20aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,9 @@ import {assert} from '../util/assert.js';
import tar from 'tar-fs';
import bzip from 'unbzip2-stream';
const {PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM} = process.env;
const experimentalChromiumMacArm =
process.env['PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM'] ||
process.env['npm_config_puppeteer_experimental_chromium_mac_arm'];
const debugFetcher = debug('puppeteer:fetcher');
@ -224,7 +226,7 @@ export class BrowserFetcher {
switch (this.#product) {
case 'chrome':
this.#platform =
os.arch() === 'arm64' && PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM
os.arch() === 'arm64' && experimentalChromiumMacArm
? 'mac_arm'
: 'mac';
break;