mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs (test-typescript-js.md): clarify TS ESM config (#18971)
Signed-off-by: Eduardo Vargas Torres <evargast@adobe.com>
This commit is contained in:
parent
b5d756686d
commit
490ae796f3
@ -34,7 +34,7 @@ test('example', async ({ page }) => {
|
||||
|
||||
You can opt into using [ECMAScript modules](https://nodejs.org/api/esm.html) by setting `type: "module"` in your `package.json` file. Playwright Test will switch to the ESM mode once it reads the `playwright.config.ts` file, so make sure you have one.
|
||||
|
||||
Playwright Test follows the [experimental support for ESM in TypeScript](https://www.typescriptlang.org/docs/handbook/esm-node.html) and, according to the specification, **requires an extension** when importing from a module, either `'.js'` or `'.ts'`.
|
||||
Playwright Test follows the [experimental support for ESM in TypeScript](https://www.typescriptlang.org/docs/handbook/esm-node.html) and, according to the specification, **requires a file extension** when importing from a module, either `'.js'` or `'.ts'`.
|
||||
|
||||
First, enable modules in your `package.json`:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user