Skip to content

Commit

Permalink
fix: use require.resolve instead of __dirname (#8003)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Feb 14, 2022
1 parent f588c27 commit bbb186d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/initialize-node.ts
Expand Up @@ -17,11 +17,13 @@
import { PuppeteerNode } from './node/Puppeteer.js';
import { PUPPETEER_REVISIONS } from './revisions.js';
import { sync } from 'pkg-dir';
import { dirname } from 'path';
import { Product } from './common/Product.js';

export const initializePuppeteerNode = (packageName: string): PuppeteerNode => {
const puppeteerRootDirectory = sync(__dirname);

const puppeteerRootDirectory = sync(
dirname(require.resolve('./initialize-node'))
);
let preferredRevision = PUPPETEER_REVISIONS.chromium;
const isPuppeteerCore = packageName === 'puppeteer-core';
// puppeteer-core ignores environment variables
Expand Down

0 comments on commit bbb186d

Please sign in to comment.