Skip to content

chore: use import instead of require in generated JS examples#131

Merged
mxschmitt merged 1 commit intomainfrom
import-instead-of-require
Oct 23, 2024
Merged

chore: use import instead of require in generated JS examples#131
mxschmitt merged 1 commit intomainfrom
import-instead-of-require

Conversation

@mxschmitt
Copy link
Copy Markdown
Contributor

@mxschmitt mxschmitt commented Oct 23, 2024

We transform everything which allows us to use import in JS files. This means we don't need to feature detect esm/cjs on the create-playwright side and can emit import all the time.

This follows our strategy to only show TS examples in the docs, since they match JS in most of the cases % types.

Closes microsoft/playwright#33238

@mxschmitt mxschmitt changed the title chore: use import instead of require chore: use import instead of require in generated JS examples Oct 23, 2024
@mxschmitt mxschmitt merged commit 34403ed into main Oct 23, 2024
@mxschmitt mxschmitt deleted the import-instead-of-require branch October 23, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Example spec uses CommonJS instead of ESM, even though type:module is set in package.json (JavaScript project)

2 participants