fix: don't detect project root for puppeteer-core (#8907)

Closes #8896
This commit is contained in:
Alex Rudenko 2022-09-06 14:26:05 +02:00 committed by GitHub
parent 6e7c6368d3
commit b4f5ea1167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,6 @@ import {getPackageDirectory} from './util/getPackageDirectory.js';
*/ */
export const initializePuppeteer = (packageName: string): PuppeteerNode => { export const initializePuppeteer = (packageName: string): PuppeteerNode => {
const isPuppeteerCore = packageName === 'puppeteer-core'; const isPuppeteerCore = packageName === 'puppeteer-core';
const puppeteerRootDirectory = getPackageDirectory(rootDirname);
let preferredRevision = PUPPETEER_REVISIONS.chromium; let preferredRevision = PUPPETEER_REVISIONS.chromium;
// puppeteer-core ignores environment variables // puppeteer-core ignores environment variables
const productName = !isPuppeteerCore const productName = !isPuppeteerCore
@ -39,7 +38,7 @@ export const initializePuppeteer = (packageName: string): PuppeteerNode => {
} }
return new PuppeteerNode({ return new PuppeteerNode({
projectRoot: puppeteerRootDirectory, projectRoot: isPuppeteerCore ? undefined : getPackageDirectory(rootDirname),
preferredRevision, preferredRevision,
isPuppeteerCore, isPuppeteerCore,
productName, productName,