Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bun support #28875

Closed
wants to merge 1 commit into from
Closed

Add Bun support #28875

wants to merge 1 commit into from

Commits on Jan 5, 2024

  1. Add Bun support

    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]>
    Jarred-Sumner authored Jan 5, 2024
    Configuration menu
    Copy the full SHA
    86282b2 View commit details
    Browse the repository at this point in the history