Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: do not inline package.json into coreBundle (#40093)

Yury Semikhatsky50b5779a1623
diff --git a/packages/playwright-core/src/package.ts b/packages/playwright-core/src/package.ts
index d114e7e773..180f16392d 100644
--- a/packages/playwright-core/src/package.ts
+++ b/packages/playwright-core/src/package.ts
@@ -16,8 +16,10 @@
import path from 'path';
-export const packageJSON = require('../package.json');
-export const packageRoot = path.dirname(require.resolve('../package.json'));
+// Use a dynamic path so esbuild does not statically resolve and inline
+// package.json into coreBundle.js.
+export const packageRoot = path.join(__dirname, '..');
+export const packageJSON = require(path.join(packageRoot, 'package.json'));
export const binPath = path.join(packageRoot, 'bin');
export function libPath(...parts: string[]): string {