mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: use require.resolve instead of __dirname (#8003)
This commit is contained in:
parent
f588c27db9
commit
bbb186d88c
@ -17,11 +17,13 @@
|
|||||||
import { PuppeteerNode } from './node/Puppeteer.js';
|
import { PuppeteerNode } from './node/Puppeteer.js';
|
||||||
import { PUPPETEER_REVISIONS } from './revisions.js';
|
import { PUPPETEER_REVISIONS } from './revisions.js';
|
||||||
import { sync } from 'pkg-dir';
|
import { sync } from 'pkg-dir';
|
||||||
|
import { dirname } from 'path';
|
||||||
import { Product } from './common/Product.js';
|
import { Product } from './common/Product.js';
|
||||||
|
|
||||||
export const initializePuppeteerNode = (packageName: string): PuppeteerNode => {
|
export const initializePuppeteerNode = (packageName: string): PuppeteerNode => {
|
||||||
const puppeteerRootDirectory = sync(__dirname);
|
const puppeteerRootDirectory = sync(
|
||||||
|
dirname(require.resolve('./initialize-node'))
|
||||||
|
);
|
||||||
let preferredRevision = PUPPETEER_REVISIONS.chromium;
|
let preferredRevision = PUPPETEER_REVISIONS.chromium;
|
||||||
const isPuppeteerCore = packageName === 'puppeteer-core';
|
const isPuppeteerCore = packageName === 'puppeteer-core';
|
||||||
// puppeteer-core ignores environment variables
|
// puppeteer-core ignores environment variables
|
||||||
|
Loading…
Reference in New Issue
Block a user