Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a `package.json` `"exports"` condition for Bun which always chooses the CommonJS version of the export (for both ESM & CJS). This package uses `__esModule` to tell bundlers that it was ESM converted into CommonJS. Bun supports this both at runtime and when using the bundler, but Node.js does not support this at runtime and that causes a compatibility issue when importing `@playwright/test` (which is our fault). It's unfortunately a compatibility issue whether or not we support `__esModule`, because choosing to not support it breaks libraries which presently only work when using a bundler. Since Bun automatically converts CommonJS <> ESM and `module.exports` with dynamic properties are supported, we can choose to always use the CommonJS entry point for Playwright in Bun. There were other changes necessary to get Playwright to work, which are mostly in oven-sh/bun#7958 Signed-off-by: Jarred Sumner <[email protected]>
- Loading branch information