Skip to content

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

chore: remove 'as *' imports because of `esModuleInterop: true` (#34854)

Max Schmitt3584e7222374
diff --git a/docs/src/auth.md b/docs/src/auth.md
index 19c97c7c43..4a3853edf1 100644
--- a/docs/src/auth.md
+++ b/docs/src/auth.md
@@ -47,7 +47,7 @@ Create `tests/auth.setup.ts` that will prepare authenticated browser state for a
```js title="tests/auth.setup.ts"
import { test as setup, expect } from '@playwright/test';
-import * as path from 'path';
+import path from 'path';
const authFile = path.join(__dirname, '../playwright/.auth/user.json');
@@ -143,8 +143,8 @@ Create `playwright/fixtures.ts` file that will [override `storageState` fixture]
```js title="playwright/fixtures.ts"
import { test as baseTest, expect } from '@playwright/test';
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
@@ -348,8 +348,8 @@ Alternatively, in a [worker fixture](#moderate-one-account-per-parallel-worker):
```js title="playwright/fixtures.ts"
import { test as baseTest, request } from '@playwright/test';
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
diff --git a/docs/src/chrome-extensions-js-python.md b/docs/src/chrome-extensions-js-python.md
index 3ac6692f16..5cabc1c864 100644
--- a/docs/src/chrome-extensions-js-python.md
+++ b/docs/src/chrome-extensions-js-python.md
@@ -109,7 +109,7 @@ First, add fixtures that will load the extension:
```js title="fixtures.ts"
import { test as base, chromium, type BrowserContext } from '@playwright/test';
-import * as path from 'path';
+import path from 'path';
export const test = base.extend<{
context: BrowserContext;
diff --git a/docs/src/evaluating.md b/docs/src/evaluating.md
index d1ee75b8a8..903aeb8a90 100644
--- a/docs/src/evaluating.md
+++ b/docs/src/evaluating.md
@@ -389,7 +389,7 @@ Next, add init script to the page.
```js
import { test, expect } from '@playwright/test';
-import * as path from 'path';
+import path from 'path';
test.beforeEach(async ({ page }) => {
// Add script for every test in the beforeEach hook.
diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md
index 5515252b39..0acafa16c5 100644
--- a/docs/src/test-api/class-testconfig.md
+++ b/docs/src/test-api/class-testconfig.md
@@ -291,7 +291,7 @@ Here is an example that uses [`method: TestInfo.outputPath`] to create a tempora
```js
import { test, expect } from '@playwright/test';
-import * as fs from 'fs';
+import fs from 'fs';
test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
diff --git a/docs/src/test-api/class-testinfo.md b/docs/src/test-api/class-testinfo.md
index b612699db6..93cbc93b75 100644
--- a/docs/src/test-api/class-testinfo.md
+++ b/docs/src/test-api/class-testinfo.md
@@ -254,7 +254,7 @@ Returns a path inside the [`property: TestInfo.outputDir`] where the test can sa
```js
import { test, expect } from '@playwright/test';
-import * as fs from 'fs';
+import fs from 'fs';
test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('dir', 'temporary-file.txt');
diff --git a/docs/src/test-api/class-testproject.md b/docs/src/test-api/class-testproject.md
index e0dda139a3..17fecf6930 100644
--- a/docs/src/test-api/class-testproject.md
+++ b/docs/src/test-api/class-testproject.md
@@ -212,7 +212,7 @@ Here is an example that uses [`method: TestInfo.outputPath`] to create a tempora
```js
import { test, expect } from '@playwright/test';
-import * as fs from 'fs';
+import fs from 'fs';
test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
diff --git a/docs/src/test-fixtures-js.md b/docs/src/test-fixtures-js.md
index 1f806d06ab..fc571477f9 100644
--- a/docs/src/test-fixtures-js.md
+++ b/docs/src/test-fixtures-js.md
@@ -408,7 +408,7 @@ Here is an example fixture that automatically attaches debug logs when the test
```js title="my-test.ts"
import debug from 'debug';
-import * as fs from 'fs';
+import fs from 'fs';
import { test as base } from '@playwright/test';
export const test = base.extend<{ saveLogs: void }>({
diff --git a/docs/src/test-parameterize-js.md b/docs/src/test-parameterize-js.md
index 8670006833..7575f96695 100644
--- a/docs/src/test-parameterize-js.md
+++ b/docs/src/test-parameterize-js.md
@@ -262,7 +262,7 @@ To make environment variables easier to manage, consider something like `.env` f
```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
import dotenv from 'dotenv';
-import * as path from 'path';
+import path from 'path';
// Read from ".env" file.
dotenv.config({ path: path.resolve(__dirname, '.env') });
@@ -309,8 +309,8 @@ See for example this CSV file, in our example `input.csv`:
Based on this we'll generate some tests by using the [csv-parse](https://www.npmjs.com/package/csv-parse) library from NPM:
```js title="test.spec.ts"
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { test } from '@playwright/test';
import { parse } from 'csv-parse/sync';
diff --git a/docs/src/webview2.md b/docs/src/webview2.md
index 81a9f698ad..7aef7216ca 100644
--- a/docs/src/webview2.md
+++ b/docs/src/webview2.md
@@ -72,9 +72,9 @@ Using the following, Playwright will run your WebView2 application as a sub-proc
```js title="webView2Test.ts"
import { test as base } from '@playwright/test';
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import childProcess from 'child_process';
const EXECUTABLE_PATH = path.join(
diff --git a/packages/html-reporter/bundle.ts b/packages/html-reporter/bundle.ts
index cb85f309d8..63530cfaad 100644
--- a/packages/html-reporter/bundle.ts
+++ b/packages/html-reporter/bundle.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import type { Plugin, UserConfig } from 'vite';
export function bundle(): Plugin {
diff --git a/packages/html-reporter/playwright.config.ts b/packages/html-reporter/playwright.config.ts
index d2160cd009..1e6cb8b8a3 100644
--- a/packages/html-reporter/playwright.config.ts
+++ b/packages/html-reporter/playwright.config.ts
@@ -15,8 +15,8 @@
*/
import { devices, defineConfig } from '@playwright/experimental-ct-react';
-import * as path from 'path';
-import * as url from 'url';
+import path from 'path';
+import url from 'url';
export default defineConfig({
testDir: 'src',
diff --git a/packages/html-reporter/vite.config.ts b/packages/html-reporter/vite.config.ts
index bdde2574d5..f0032feb27 100644
--- a/packages/html-reporter/vite.config.ts
+++ b/packages/html-reporter/vite.config.ts
@@ -17,7 +17,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { bundle } from './bundle';
-import * as path from 'path';
+import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
diff --git a/packages/playwright-core/src/cli/driver.ts b/packages/playwright-core/src/cli/driver.ts
index 104db006cc..de8d94293c 100644
--- a/packages/playwright-core/src/cli/driver.ts
+++ b/packages/playwright-core/src/cli/driver.ts
@@ -16,7 +16,7 @@
/* eslint-disable no-console */
-import * as fs from 'fs';
+import fs from 'fs';
import * as playwright from '../..';
import { PipeTransport } from '../server/utils/pipeTransport';
diff --git a/packages/playwright-core/src/cli/program.ts b/packages/playwright-core/src/cli/program.ts
index 4a9b4b9bb9..e69cc7f793 100644
--- a/packages/playwright-core/src/cli/program.ts
+++ b/packages/playwright-core/src/cli/program.ts
@@ -16,9 +16,9 @@
/* eslint-disable no-console */
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import * as playwright from '../..';
import { launchBrowserServer, printApiJson, runDriver, runServer } from './driver';
diff --git a/packages/playwright-core/src/outofprocess.ts b/packages/playwright-core/src/outofprocess.ts
index 6906b7ea1c..7225bbb569 100644
--- a/packages/playwright-core/src/outofprocess.ts
+++ b/packages/playwright-core/src/outofprocess.ts
@@ -15,7 +15,7 @@
*/
import * as childProcess from 'child_process';
-import * as path from 'path';
+import path from 'path';
import { createConnectionFactory } from './client/clientBundle';
import { PipeTransport } from './server/utils/pipeTransport';
diff --git a/packages/playwright-core/src/server/android/android.ts b/packages/playwright-core/src/server/android/android.ts
index 5215cc6d01..f85beb6e73 100644
--- a/packages/playwright-core/src/server/android/android.ts
+++ b/packages/playwright-core/src/server/android/android.ts
@@ -15,9 +15,9 @@
*/
import { EventEmitter } from 'events';
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { TimeoutSettings } from '../timeoutSettings';
import { PipeTransport } from '../utils/pipeTransport';
diff --git a/packages/playwright-core/src/server/android/backendAdb.ts b/packages/playwright-core/src/server/android/backendAdb.ts
index 4b1787a78b..88b7c8896a 100644
--- a/packages/playwright-core/src/server/android/backendAdb.ts
+++ b/packages/playwright-core/src/server/android/backendAdb.ts
@@ -15,7 +15,7 @@
*/
import { EventEmitter } from 'events';
-import * as net from 'net';
+import net from 'net';
import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
diff --git a/packages/playwright-core/src/server/artifact.ts b/packages/playwright-core/src/server/artifact.ts
index 703e2d9e89..c6f2b4bc9c 100644
--- a/packages/playwright-core/src/server/artifact.ts
+++ b/packages/playwright-core/src/server/artifact.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { assert } from '../utils';
import { TargetClosedError } from './errors';
diff --git a/packages/playwright-core/src/server/bidi/bidiChromium.ts b/packages/playwright-core/src/server/bidi/bidiChromium.ts
index a258338537..37b3dc21c1 100644
--- a/packages/playwright-core/src/server/bidi/bidiChromium.ts
+++ b/packages/playwright-core/src/server/bidi/bidiChromium.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as os from 'os';
+import os from 'os';
import { assert } from '../../utils';
import { wrapInASCIIBox } from '../utils/ascii';
diff --git a/packages/playwright-core/src/server/bidi/bidiFirefox.ts b/packages/playwright-core/src/server/bidi/bidiFirefox.ts
index 5f0d7ac12e..7af6fd43aa 100644
--- a/packages/playwright-core/src/server/bidi/bidiFirefox.ts
+++ b/packages/playwright-core/src/server/bidi/bidiFirefox.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as os from 'os';
-import * as path from 'path';
+import os from 'os';
+import path from 'path';
import { assert } from '../../utils';
import { wrapInASCIIBox } from '../utils/ascii';
diff --git a/packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts b/packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts
index 4b246f6c3b..3e0c347b52 100644
--- a/packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts
+++ b/packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
/* eslint-disable curly, indent */
diff --git a/packages/playwright-core/src/server/browserContext.ts b/packages/playwright-core/src/server/browserContext.ts
index 3fdb08577b..a57af3bf12 100644
--- a/packages/playwright-core/src/server/browserContext.ts
+++ b/packages/playwright-core/src/server/browserContext.ts
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { TimeoutSettings } from './timeoutSettings';
import { createGuid } from './utils/crypto';
diff --git a/packages/playwright-core/src/server/browserType.ts b/packages/playwright-core/src/server/browserType.ts
index 0ecfccc510..c4c44d83de 100644
--- a/packages/playwright-core/src/server/browserType.ts
+++ b/packages/playwright-core/src/server/browserType.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { normalizeProxySettings, validateBrowserContextOptions } from './browserContext';
import { DEFAULT_TIMEOUT, TimeoutSettings } from './timeoutSettings';
diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts
index 9cbb84b2ac..35acc621e2 100644
--- a/packages/playwright-core/src/server/chromium/chromium.ts
+++ b/packages/playwright-core/src/server/chromium/chromium.ts
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { chromiumSwitches } from './chromiumSwitches';
import { CRBrowser } from './crBrowser';
diff --git a/packages/playwright-core/src/server/chromium/crBrowser.ts b/packages/playwright-core/src/server/chromium/crBrowser.ts
index fe76876a92..9f0179600d 100644
--- a/packages/playwright-core/src/server/chromium/crBrowser.ts
+++ b/packages/playwright-core/src/server/chromium/crBrowser.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
diff --git a/packages/playwright-core/src/server/chromium/crDevTools.ts b/packages/playwright-core/src/server/chromium/crDevTools.ts
index f6e6774416..5225d6d54f 100644
--- a/packages/playwright-core/src/server/chromium/crDevTools.ts
+++ b/packages/playwright-core/src/server/chromium/crDevTools.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import type { CRSession } from './crConnection';
diff --git a/packages/playwright-core/src/server/chromium/crPage.ts b/packages/playwright-core/src/server/chromium/crPage.ts
index 781f24e932..7e873fa503 100644
--- a/packages/playwright-core/src/server/chromium/crPage.ts
+++ b/packages/playwright-core/src/server/chromium/crPage.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
diff --git a/packages/playwright-core/src/server/chromium/crProtocolHelper.ts b/packages/playwright-core/src/server/chromium/crProtocolHelper.ts
index f9e1409a79..2f60ff32d0 100644
--- a/packages/playwright-core/src/server/chromium/crProtocolHelper.ts
+++ b/packages/playwright-core/src/server/chromium/crProtocolHelper.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { splitErrorMessage } from '../../utils/isomorphic/stackTrace';
import { mkdirIfNeeded } from '../utils/fileUtils';
diff --git a/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts b/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
index db5b4496bc..5a21cd7a5b 100644
--- a/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { Dispatcher, existingDispatcher } from './dispatcher';
import { StreamDispatcher } from './streamDispatcher';
diff --git a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
index d3f110f54e..878f18f7ca 100644
--- a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { BrowserContext } from '../browserContext';
import { ArtifactDispatcher } from './artifactDispatcher';
diff --git a/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts b/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
index 08757f5d88..7bd6f1fd74 100644
--- a/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { Dispatcher } from './dispatcher';
import { createGuid } from '../utils/crypto';
diff --git a/packages/playwright-core/src/server/dom.ts b/packages/playwright-core/src/server/dom.ts
index f694336f59..2c93f113e4 100644
--- a/packages/playwright-core/src/server/dom.ts
+++ b/packages/playwright-core/src/server/dom.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import * as js from './javascript';
import { ProgressController } from './progress';
diff --git a/packages/playwright-core/src/server/download.ts b/packages/playwright-core/src/server/download.ts
index 85840b7ff2..eeb9476406 100644
--- a/packages/playwright-core/src/server/download.ts
+++ b/packages/playwright-core/src/server/download.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { Page } from './page';
import { assert } from '../utils';
diff --git a/packages/playwright-core/src/server/electron/electron.ts b/packages/playwright-core/src/server/electron/electron.ts
index d6fe4b01dd..eb9d2f3e5c 100644
--- a/packages/playwright-core/src/server/electron/electron.ts
+++ b/packages/playwright-core/src/server/electron/electron.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import * as readline from 'readline';
import { TimeoutSettings } from '../timeoutSettings';
diff --git a/packages/playwright-core/src/server/fetch.ts b/packages/playwright-core/src/server/fetch.ts
index 23f0c87a51..984d5e3067 100644
--- a/packages/playwright-core/src/server/fetch.ts
+++ b/packages/playwright-core/src/server/fetch.ts
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-import * as http from 'http';
-import * as https from 'https';
+import http from 'http';
+import https from 'https';
import { Transform, pipeline } from 'stream';
import { TLSSocket } from 'tls';
-import * as url from 'url';
+import url from 'url';
import * as zlib from 'zlib';
import { TimeoutSettings } from './timeoutSettings';
diff --git a/packages/playwright-core/src/server/fileUploadUtils.ts b/packages/playwright-core/src/server/fileUploadUtils.ts
index d2e18572b9..83ea9e015e 100644
--- a/packages/playwright-core/src/server/fileUploadUtils.ts
+++ b/packages/playwright-core/src/server/fileUploadUtils.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { assert } from '../utils/isomorphic/assert';
import { mime } from '../utilsBundle';
diff --git a/packages/playwright-core/src/server/firefox/firefox.ts b/packages/playwright-core/src/server/firefox/firefox.ts
index 1332fbc4d0..8c6959c554 100644
--- a/packages/playwright-core/src/server/firefox/firefox.ts
+++ b/packages/playwright-core/src/server/firefox/firefox.ts
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-import * as os from 'os';
-import * as path from 'path';
+import os from 'os';
+import path from 'path';
import { FFBrowser } from './ffBrowser';
import { kBrowserCloseMessageId } from './ffConnection';
diff --git a/packages/playwright-core/src/server/har/harRecorder.ts b/packages/playwright-core/src/server/har/harRecorder.ts
index 12489f1c4c..3edcf8f787 100644
--- a/packages/playwright-core/src/server/har/harRecorder.ts
+++ b/packages/playwright-core/src/server/har/harRecorder.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { Artifact } from '../artifact';
import { HarTracer } from './harTracer';
diff --git a/packages/playwright-core/src/server/harBackend.ts b/packages/playwright-core/src/server/harBackend.ts
index 4a59b9ab60..b3a6dc0fa9 100644
--- a/packages/playwright-core/src/server/harBackend.ts
+++ b/packages/playwright-core/src/server/harBackend.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { createGuid } from './utils/crypto';
import { ZipFile } from './utils/zipFile';
diff --git a/packages/playwright-core/src/server/launchApp.ts b/packages/playwright-core/src/server/launchApp.ts
index 009748395a..84b4c6d6d2 100644
--- a/packages/playwright-core/src/server/launchApp.ts
+++ b/packages/playwright-core/src/server/launchApp.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { isUnderTest } from '../utils';
import { serverSideCallMetadata } from './instrumentation';
diff --git a/packages/playwright-core/src/server/localUtils.ts b/packages/playwright-core/src/server/localUtils.ts
index 7751d20fdb..c16584b278 100644
--- a/packages/playwright-core/src/server/localUtils.ts
+++ b/packages/playwright-core/src/server/localUtils.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { calculateSha1 } from './utils/crypto';
import { HarBackend } from './harBackend';
diff --git a/packages/playwright-core/src/server/recorder.ts b/packages/playwright-core/src/server/recorder.ts
index f8fc140219..aac9ab696b 100644
--- a/packages/playwright-core/src/server/recorder.ts
+++ b/packages/playwright-core/src/server/recorder.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import * as consoleApiSource from '../generated/consoleApiSource';
import { isUnderTest } from '../utils';
diff --git a/packages/playwright-core/src/server/recorder/recorderApp.ts b/packages/playwright-core/src/server/recorder/recorderApp.ts
index 5233edaedd..53563b71a0 100644
--- a/packages/playwright-core/src/server/recorder/recorderApp.ts
+++ b/packages/playwright-core/src/server/recorder/recorderApp.ts
@@ -15,8 +15,8 @@
*/
import { EventEmitter } from 'events';
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { isUnderTest } from '../utils/debug';
import { mime } from '../../utilsBundle';
diff --git a/packages/playwright-core/src/server/recorder/throttledFile.ts b/packages/playwright-core/src/server/recorder/throttledFile.ts
index 4a34f41a0c..e0d1c93568 100644
--- a/packages/playwright-core/src/server/recorder/throttledFile.ts
+++ b/packages/playwright-core/src/server/recorder/throttledFile.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
export class ThrottledFile {
private _file: string;
diff --git a/packages/playwright-core/src/server/registry/browserFetcher.ts b/packages/playwright-core/src/server/registry/browserFetcher.ts
index 6a84f2573a..38a3e860c6 100644
--- a/packages/playwright-core/src/server/registry/browserFetcher.ts
+++ b/packages/playwright-core/src/server/registry/browserFetcher.ts
@@ -16,9 +16,9 @@
*/
import * as childProcess from 'child_process';
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { debugLogger } from '../utils/debugLogger';
import { ManualPromise } from '../../utils/isomorphic/manualPromise';
diff --git a/packages/playwright-core/src/server/registry/dependencies.ts b/packages/playwright-core/src/server/registry/dependencies.ts
index 5cf4a097b1..2b97d02d20 100644
--- a/packages/playwright-core/src/server/registry/dependencies.ts
+++ b/packages/playwright-core/src/server/registry/dependencies.ts
@@ -15,9 +15,9 @@
*/
import * as childProcess from 'child_process';
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { deps } from './nativeDeps';
import { wrapInASCIIBox } from '../utils/ascii';
diff --git a/packages/playwright-core/src/server/registry/index.ts b/packages/playwright-core/src/server/registry/index.ts
index e0282120fb..e7687d1840 100644
--- a/packages/playwright-core/src/server/registry/index.ts
+++ b/packages/playwright-core/src/server/registry/index.ts
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import * as util from 'util';
import { downloadBrowserWithProgressBar, logPolitely } from './browserFetcher';
diff --git a/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts b/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts
index bda904f47a..770a6334fe 100644
--- a/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts
+++ b/packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { ManualPromise } from '../../utils/isomorphic/manualPromise';
import { httpRequest } from '../utils/network';
diff --git a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
index f769f60d74..a68cb88abb 100644
--- a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
+++ b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
@@ -15,10 +15,10 @@
*/
import { EventEmitter } from 'events';
-import * as http2 from 'http2';
-import * as net from 'net';
-import * as stream from 'stream';
-import * as tls from 'tls';
+import http2 from 'http2';
+import net from 'net';
+import stream from 'stream';
+import tls from 'tls';
import { SocksProxy } from './utils/socksProxy';
import { ManualPromise, escapeHTML, generateSelfSignedCertificate, rewriteErrorMessage } from '../utils';
diff --git a/packages/playwright-core/src/server/trace/recorder/tracing.ts b/packages/playwright-core/src/server/trace/recorder/tracing.ts
index 41d2680757..fd9a724726 100644
--- a/packages/playwright-core/src/server/trace/recorder/tracing.ts
+++ b/packages/playwright-core/src/server/trace/recorder/tracing.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { Snapshotter } from './snapshotter';
import { commandsWithTracingSnapshots } from '../../../protocol/debug';
diff --git a/packages/playwright-core/src/server/trace/viewer/traceViewer.ts b/packages/playwright-core/src/server/trace/viewer/traceViewer.ts
index d3ab2f9b51..2b4d4d90f9 100644
--- a/packages/playwright-core/src/server/trace/viewer/traceViewer.ts
+++ b/packages/playwright-core/src/server/trace/viewer/traceViewer.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { gracefullyProcessExitDoNotHang } from '../../../utils';
import { isUnderTest } from '../../../utils';
diff --git a/packages/playwright-core/src/server/utils/crypto.ts b/packages/playwright-core/src/server/utils/crypto.ts
index c3ca75efd7..ab51dbb25a 100644
--- a/packages/playwright-core/src/server/utils/crypto.ts
+++ b/packages/playwright-core/src/server/utils/crypto.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as crypto from 'crypto';
+import crypto from 'crypto';
import { assert } from '../../utils/isomorphic/assert';
diff --git a/packages/playwright-core/src/server/utils/debugLogger.ts b/packages/playwright-core/src/server/utils/debugLogger.ts
index 8713b3cf7e..84a0f53d82 100644
--- a/packages/playwright-core/src/server/utils/debugLogger.ts
+++ b/packages/playwright-core/src/server/utils/debugLogger.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { debug } from '../../utilsBundle';
diff --git a/packages/playwright-core/src/server/utils/fileUtils.ts b/packages/playwright-core/src/server/utils/fileUtils.ts
index 0a0a95d2a1..4179df79fe 100644
--- a/packages/playwright-core/src/server/utils/fileUtils.ts
+++ b/packages/playwright-core/src/server/utils/fileUtils.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { ManualPromise } from '../../utils/isomorphic/manualPromise';
import { yazl } from '../../zipBundle';
diff --git a/packages/playwright-core/src/server/utils/happyEyeballs.ts b/packages/playwright-core/src/server/utils/happyEyeballs.ts
index c8c0f4182c..eb8531db4c 100644
--- a/packages/playwright-core/src/server/utils/happyEyeballs.ts
+++ b/packages/playwright-core/src/server/utils/happyEyeballs.ts
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-import * as dns from 'dns';
-import * as http from 'http';
-import * as https from 'https';
-import * as net from 'net';
-import * as tls from 'tls';
+import dns from 'dns';
+import http from 'http';
+import https from 'https';
+import net from 'net';
+import tls from 'tls';
import { assert } from '../../utils/isomorphic/assert';
import { ManualPromise } from '../../utils/isomorphic/manualPromise';
diff --git a/packages/playwright-core/src/server/utils/hostPlatform.ts b/packages/playwright-core/src/server/utils/hostPlatform.ts
index 058b5b9f78..11ab5af60f 100644
--- a/packages/playwright-core/src/server/utils/hostPlatform.ts
+++ b/packages/playwright-core/src/server/utils/hostPlatform.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as os from 'os';
+import os from 'os';
import { getLinuxDistributionInfoSync } from './linuxUtils';
diff --git a/packages/playwright-core/src/server/utils/httpServer.ts b/packages/playwright-core/src/server/utils/httpServer.ts
index 7c8a67e10c..0fd977f3c0 100644
--- a/packages/playwright-core/src/server/utils/httpServer.ts
+++ b/packages/playwright-core/src/server/utils/httpServer.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { mime, wsServer } from '../../utilsBundle';
import { createGuid } from './crypto';
diff --git a/packages/playwright-core/src/server/utils/linuxUtils.ts b/packages/playwright-core/src/server/utils/linuxUtils.ts
index 3c85ebe091..86d6362588 100644
--- a/packages/playwright-core/src/server/utils/linuxUtils.ts
+++ b/packages/playwright-core/src/server/utils/linuxUtils.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
let didFailToReadOSRelease = false;
let osRelease: {
diff --git a/packages/playwright-core/src/server/utils/network.ts b/packages/playwright-core/src/server/utils/network.ts
index 3b9d0ccfad..8e0357f958 100644
--- a/packages/playwright-core/src/server/utils/network.ts
+++ b/packages/playwright-core/src/server/utils/network.ts
@@ -15,10 +15,10 @@
*/
-import * as http from 'http';
-import * as http2 from 'http2';
-import * as https from 'https';
-import * as url from 'url';
+import http from 'http';
+import http2 from 'http2';
+import https from 'https';
+import url from 'url';
import { HttpsProxyAgent, getProxyForUrl } from '../../utilsBundle';
import { httpHappyEyeballsAgent, httpsHappyEyeballsAgent } from './happyEyeballs';
diff --git a/packages/playwright-core/src/server/utils/nodePlatform.ts b/packages/playwright-core/src/server/utils/nodePlatform.ts
index 395b903c51..20944ae3f4 100644
--- a/packages/playwright-core/src/server/utils/nodePlatform.ts
+++ b/packages/playwright-core/src/server/utils/nodePlatform.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as crypto from 'crypto';
-import * as fs from 'fs';
-import * as path from 'path';
+import crypto from 'crypto';
+import fs from 'fs';
+import path from 'path';
import * as util from 'util';
import { Readable, Writable, pipeline } from 'stream';
import { EventEmitter } from 'events';
diff --git a/packages/playwright-core/src/server/utils/processLauncher.ts b/packages/playwright-core/src/server/utils/processLauncher.ts
index a7bc0a3865..90bc1507fc 100644
--- a/packages/playwright-core/src/server/utils/processLauncher.ts
+++ b/packages/playwright-core/src/server/utils/processLauncher.ts
@@ -16,7 +16,7 @@
*/
import * as childProcess from 'child_process';
-import * as fs from 'fs';
+import fs from 'fs';
import * as readline from 'readline';
import { removeFolders } from './fileUtils';
diff --git a/packages/playwright-core/src/server/utils/profiler.ts b/packages/playwright-core/src/server/utils/profiler.ts
index b68d960404..e414f0ff4a 100644
--- a/packages/playwright-core/src/server/utils/profiler.ts
+++ b/packages/playwright-core/src/server/utils/profiler.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
const profileDir = process.env.PWTEST_PROFILE_DIR || '';
diff --git a/packages/playwright-core/src/server/utils/socksProxy.ts b/packages/playwright-core/src/server/utils/socksProxy.ts
index bd36ed58f5..40c62c43c3 100644
--- a/packages/playwright-core/src/server/utils/socksProxy.ts
+++ b/packages/playwright-core/src/server/utils/socksProxy.ts
@@ -15,7 +15,7 @@
*/
import EventEmitter from 'events';
-import * as net from 'net';
+import net from 'net';
import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from './crypto';
diff --git a/packages/playwright-core/src/server/utils/userAgent.ts b/packages/playwright-core/src/server/utils/userAgent.ts
index 9676a5bae5..d9c7619ac5 100644
--- a/packages/playwright-core/src/server/utils/userAgent.ts
+++ b/packages/playwright-core/src/server/utils/userAgent.ts
@@ -15,7 +15,7 @@
*/
import { execSync } from 'child_process';
-import * as os from 'os';
+import os from 'os';
import { getLinuxDistributionInfoSync } from '../utils/linuxUtils';
diff --git a/packages/playwright-core/src/server/webkit/webkit.ts b/packages/playwright-core/src/server/webkit/webkit.ts
index a3d1647f07..5b5519264c 100644
--- a/packages/playwright-core/src/server/webkit/webkit.ts
+++ b/packages/playwright-core/src/server/webkit/webkit.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { kBrowserCloseMessageId } from './wkConnection';
import { wrapInASCIIBox } from '../utils/ascii';
diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.ts
index 5846b800d8..eb8b536b29 100644
--- a/packages/playwright-core/src/server/webkit/wkPage.ts
+++ b/packages/playwright-core/src/server/webkit/wkPage.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { assert } from '../../utils';
import { headersArrayToObject } from '../../utils/isomorphic/headers';
diff --git a/packages/playwright-ct-core/src/devServer.ts b/packages/playwright-ct-core/src/devServer.ts
index e93a633b1b..6e3b555a07 100644
--- a/packages/playwright-ct-core/src/devServer.ts
+++ b/packages/playwright-ct-core/src/devServer.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { Watcher } from 'playwright/lib/fsWatcher';
diff --git a/packages/playwright-ct-core/src/tsxTransform.ts b/packages/playwright-ct-core/src/tsxTransform.ts
index ece6dbccd0..f2fad4efa8 100644
--- a/packages/playwright-ct-core/src/tsxTransform.ts
+++ b/packages/playwright-ct-core/src/tsxTransform.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { declare, traverse, types } from 'playwright/lib/transform/babelBundle';
import { setTransformData } from 'playwright/lib/transform/transform';
diff --git a/packages/playwright-ct-core/src/vitePlugin.ts b/packages/playwright-ct-core/src/vitePlugin.ts
index 0e2091b928..d31af197d1 100644
--- a/packages/playwright-ct-core/src/vitePlugin.ts
+++ b/packages/playwright-ct-core/src/vitePlugin.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { setExternalDependencies } from 'playwright/lib/transform/compilationCache';
import { resolveHook } from 'playwright/lib/transform/transform';
diff --git a/packages/playwright-ct-core/src/viteUtils.ts b/packages/playwright-ct-core/src/viteUtils.ts
index 5873ad4bf0..58bfececc9 100644
--- a/packages/playwright-ct-core/src/viteUtils.ts
+++ b/packages/playwright-ct-core/src/viteUtils.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { getUserData } from 'playwright/lib/transform/compilationCache';
import { resolveHook } from 'playwright/lib/transform/transform';
diff --git a/packages/playwright/bundles/babel/src/babelBundleImpl.ts b/packages/playwright/bundles/babel/src/babelBundleImpl.ts
index a040deddb2..2810a1bd5c 100644
--- a/packages/playwright/bundles/babel/src/babelBundleImpl.ts
+++ b/packages/playwright/bundles/babel/src/babelBundleImpl.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import * as babel from '@babel/core';
import traverseFunction from '@babel/traverse';
diff --git a/packages/playwright/src/common/config.ts b/packages/playwright/src/common/config.ts
index 59d1973578..4578c3771a 100644
--- a/packages/playwright/src/common/config.ts
+++ b/packages/playwright/src/common/config.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { getPackageJsonPath, mergeObjects } from '../util';
diff --git a/packages/playwright/src/common/configLoader.ts b/packages/playwright/src/common/configLoader.ts
index 440bf083fb..371a59d086 100644
--- a/packages/playwright/src/common/configLoader.ts
+++ b/packages/playwright/src/common/configLoader.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { gracefullyProcessExitDoNotHang } from 'playwright-core/lib/utils';
import { isRegExp } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/common/esmLoaderHost.ts b/packages/playwright/src/common/esmLoaderHost.ts
index fbe5704044..1c8ef09585 100644
--- a/packages/playwright/src/common/esmLoaderHost.ts
+++ b/packages/playwright/src/common/esmLoaderHost.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as url from 'url';
+import url from 'url';
import { addToCompilationCache, serializeCompilationCache } from '../transform/compilationCache';
import { PortTransport } from '../transform/portTransport';
diff --git a/packages/playwright/src/common/fixtures.ts b/packages/playwright/src/common/fixtures.ts
index ad0a16bd22..1c2421b9b1 100644
--- a/packages/playwright/src/common/fixtures.ts
+++ b/packages/playwright/src/common/fixtures.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as crypto from 'crypto';
+import crypto from 'crypto';
import { filterStackFile, formatLocation } from '../util';
diff --git a/packages/playwright/src/common/suiteUtils.ts b/packages/playwright/src/common/suiteUtils.ts
index d229e62732..ab676548b5 100644
--- a/packages/playwright/src/common/suiteUtils.ts
+++ b/packages/playwright/src/common/suiteUtils.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { calculateSha1, toPosixPath } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/common/testLoader.ts b/packages/playwright/src/common/testLoader.ts
index 31a7b63fee..690a09643d 100644
--- a/packages/playwright/src/common/testLoader.ts
+++ b/packages/playwright/src/common/testLoader.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import util from 'util';
import * as esmLoaderHost from './esmLoaderHost';
diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.ts
index bb0ebd9513..e8afe5a74a 100644
--- a/packages/playwright/src/index.ts
+++ b/packages/playwright/src/index.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import * as playwrightLibrary from 'playwright-core';
import { setBoxedStackPrefixes, asLocator, createGuid, currentZone, debugMode, isString, jsonStringifyForceASCII } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/internalsForTest.ts b/packages/playwright/src/internalsForTest.ts
index f80d63bc7a..129f9e858d 100644
--- a/packages/playwright/src/internalsForTest.ts
+++ b/packages/playwright/src/internalsForTest.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { fileDependenciesForTest } from './transform/compilationCache';
diff --git a/packages/playwright/src/matchers/toMatchAriaSnapshot.ts b/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
index 1ad5777871..ad1855a88e 100644
--- a/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
+++ b/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
@@ -15,8 +15,8 @@
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { escapeTemplateString, isString, sanitizeForFilePath } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/matchers/toMatchSnapshot.ts b/packages/playwright/src/matchers/toMatchSnapshot.ts
index dd54e61aeb..6cefb48f1e 100644
--- a/packages/playwright/src/matchers/toMatchSnapshot.ts
+++ b/packages/playwright/src/matchers/toMatchSnapshot.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { compareBuffersOrStrings, getComparator, isString, sanitizeForFilePath } from 'playwright-core/lib/utils';
import { colors } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/plugins/webServerPlugin.ts b/packages/playwright/src/plugins/webServerPlugin.ts
index 4bb1bef0db..24d9e4d3fd 100644
--- a/packages/playwright/src/plugins/webServerPlugin.ts
+++ b/packages/playwright/src/plugins/webServerPlugin.ts
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import * as net from 'net';
-import * as path from 'path';
+import net from 'net';
+import path from 'path';
import { launchProcess, isURLAvailable, monotonicTime, raceAgainstDeadline } from 'playwright-core/lib/utils';
import { colors } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/program.ts b/packages/playwright/src/program.ts
index 19eabe6517..cb62f28f68 100644
--- a/packages/playwright/src/program.ts
+++ b/packages/playwright/src/program.ts
@@ -16,8 +16,8 @@
/* eslint-disable no-console */
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { program } from 'playwright-core/lib/cli/program';
import { gracefullyProcessExitDoNotHang, startProfiling, stopProfiling } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/base.ts b/packages/playwright/src/reporters/base.ts
index 9708532cbb..b64877e162 100644
--- a/packages/playwright/src/reporters/base.ts
+++ b/packages/playwright/src/reporters/base.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { getPackageManagerExecCommand } from 'playwright-core/lib/utils';
import { parseStackFrame } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/blob.ts b/packages/playwright/src/reporters/blob.ts
index 7c17d91ab5..4168e1cb68 100644
--- a/packages/playwright/src/reporters/blob.ts
+++ b/packages/playwright/src/reporters/blob.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { Readable } from 'stream';
import { removeFolders, sanitizeForFilePath } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/github.ts b/packages/playwright/src/reporters/github.ts
index 7c65c00b3c..9d37ec8600 100644
--- a/packages/playwright/src/reporters/github.ts
+++ b/packages/playwright/src/reporters/github.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { noColors } from 'playwright-core/lib/utils';
import { ms as milliseconds } from 'playwright-core/lib/utilsBundle';
diff --git a/packages/playwright/src/reporters/html.ts b/packages/playwright/src/reporters/html.ts
index a86a758d48..1948ec5a49 100644
--- a/packages/playwright/src/reporters/html.ts
+++ b/packages/playwright/src/reporters/html.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { Transform } from 'stream';
import { HttpServer, MultiMap, assert, calculateSha1, getPackageManagerExecCommand, copyFileAndMakeWritable, gracefullyProcessExitDoNotHang, removeFolders, sanitizeForFilePath, toPosixPath } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/internalReporter.ts b/packages/playwright/src/reporters/internalReporter.ts
index 5655bd4fb2..85e5d5fb90 100644
--- a/packages/playwright/src/reporters/internalReporter.ts
+++ b/packages/playwright/src/reporters/internalReporter.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import { monotonicTime } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/json.ts b/packages/playwright/src/reporters/json.ts
index db40750d36..b2fc664c15 100644
--- a/packages/playwright/src/reporters/json.ts
+++ b/packages/playwright/src/reporters/json.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { toPosixPath, MultiMap } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/junit.ts b/packages/playwright/src/reporters/junit.ts
index 54aa1c519b..68991c570c 100644
--- a/packages/playwright/src/reporters/junit.ts
+++ b/packages/playwright/src/reporters/junit.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { getAsBooleanFromENV } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/markdown.ts b/packages/playwright/src/reporters/markdown.ts
index 158751f1b6..8b2ea93dac 100644
--- a/packages/playwright/src/reporters/markdown.ts
+++ b/packages/playwright/src/reporters/markdown.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { resolveReporterOutputPath } from '../util';
import { TerminalReporter } from './base';
diff --git a/packages/playwright/src/reporters/merge.ts b/packages/playwright/src/reporters/merge.ts
index fcbecf865e..9e2bd2f5df 100644
--- a/packages/playwright/src/reporters/merge.ts
+++ b/packages/playwright/src/reporters/merge.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { ZipFile } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/reporters/teleEmitter.ts b/packages/playwright/src/reporters/teleEmitter.ts
index 10f31a742f..7b1571f12b 100644
--- a/packages/playwright/src/reporters/teleEmitter.ts
+++ b/packages/playwright/src/reporters/teleEmitter.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { createGuid } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/lastRun.ts b/packages/playwright/src/runner/lastRun.ts
index 158450ed41..931bca3972 100644
--- a/packages/playwright/src/runner/lastRun.ts
+++ b/packages/playwright/src/runner/lastRun.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { filterProjects } from './projectUtils';
diff --git a/packages/playwright/src/runner/loadUtils.ts b/packages/playwright/src/runner/loadUtils.ts
index 457444b94c..200f668e5d 100644
--- a/packages/playwright/src/runner/loadUtils.ts
+++ b/packages/playwright/src/runner/loadUtils.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { InProcessLoaderHost, OutOfProcessLoaderHost } from './loaderHost';
import { createFileFiltersFromArguments, createFileMatcherFromArguments, createTitleMatcher, errorWithFile, forceRegExp } from '../util';
diff --git a/packages/playwright/src/runner/projectUtils.ts b/packages/playwright/src/runner/projectUtils.ts
index 7bb1495ba3..b52503c50c 100644
--- a/packages/playwright/src/runner/projectUtils.ts
+++ b/packages/playwright/src/runner/projectUtils.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { promisify } from 'util';
import { escapeRegExp } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/rebase.ts b/packages/playwright/src/runner/rebase.ts
index ef7d49f013..79dd3fa998 100644
--- a/packages/playwright/src/runner/rebase.ts
+++ b/packages/playwright/src/runner/rebase.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { MultiMap } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/reporters.ts b/packages/playwright/src/runner/reporters.ts
index 163b8b8e3e..6b00a2599c 100644
--- a/packages/playwright/src/runner/reporters.ts
+++ b/packages/playwright/src/runner/reporters.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import { calculateSha1 } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.ts
index d6dccef0e5..2bb9c3bbe2 100644
--- a/packages/playwright/src/runner/tasks.ts
+++ b/packages/playwright/src/runner/tasks.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { promisify } from 'util';
import { monotonicTime, removeFolders } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/testServer.ts b/packages/playwright/src/runner/testServer.ts
index 4b11ac7af4..4f33702dfa 100644
--- a/packages/playwright/src/runner/testServer.ts
+++ b/packages/playwright/src/runner/testServer.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { installRootRedirect, openTraceInBrowser, openTraceViewerApp, registry, startTraceViewerServer } from 'playwright-core/lib/server';
import { ManualPromise, isUnderTest, gracefullyProcessExitDoNotHang } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/runner/vcs.ts b/packages/playwright/src/runner/vcs.ts
index 91d88bc49d..fcda961318 100644
--- a/packages/playwright/src/runner/vcs.ts
+++ b/packages/playwright/src/runner/vcs.ts
@@ -15,7 +15,7 @@
*/
import childProcess from 'child_process';
-import * as path from 'path';
+import path from 'path';
import { affectedTestFiles } from '../transform/compilationCache';
diff --git a/packages/playwright/src/runner/watchMode.ts b/packages/playwright/src/runner/watchMode.ts
index ad819853fc..4aa8264312 100644
--- a/packages/playwright/src/runner/watchMode.ts
+++ b/packages/playwright/src/runner/watchMode.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as path from 'path';
+import path from 'path';
import readline from 'readline';
import { EventEmitter } from 'stream';
diff --git a/packages/playwright/src/runner/workerHost.ts b/packages/playwright/src/runner/workerHost.ts
index d92093e72b..6c6b512574 100644
--- a/packages/playwright/src/runner/workerHost.ts
+++ b/packages/playwright/src/runner/workerHost.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { removeFolders } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/third_party/tsconfig-loader.ts b/packages/playwright/src/third_party/tsconfig-loader.ts
index b654a3b963..653e9ab081 100644
--- a/packages/playwright/src/third_party/tsconfig-loader.ts
+++ b/packages/playwright/src/third_party/tsconfig-loader.ts
@@ -24,8 +24,8 @@
/* eslint-disable */
-import * as path from 'path';
-import * as fs from 'fs';
+import path from 'path';
+import fs from 'fs';
import { json5 } from '../utilsBundle';
/**
diff --git a/packages/playwright/src/transform/compilationCache.ts b/packages/playwright/src/transform/compilationCache.ts
index ae9391d79a..87fb7f5654 100644
--- a/packages/playwright/src/transform/compilationCache.ts
+++ b/packages/playwright/src/transform/compilationCache.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
import { isWorkerProcess } from '../common/globals';
import { sourceMapSupport } from '../utilsBundle';
diff --git a/packages/playwright/src/transform/esmLoader.ts b/packages/playwright/src/transform/esmLoader.ts
index 6e6b37cf4c..6782d7c0a5 100644
--- a/packages/playwright/src/transform/esmLoader.ts
+++ b/packages/playwright/src/transform/esmLoader.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as url from 'url';
+import fs from 'fs';
+import url from 'url';
import { addToCompilationCache, currentFileDepsCollector, serializeCompilationCache, startCollectingFileDeps, stopCollectingFileDeps } from './compilationCache';
import { PortTransport } from './portTransport';
diff --git a/packages/playwright/src/transform/esmUtils.ts b/packages/playwright/src/transform/esmUtils.ts
index bfa4a23790..31851f61d3 100644
--- a/packages/playwright/src/transform/esmUtils.ts
+++ b/packages/playwright/src/transform/esmUtils.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import * as url from 'url';
+import url from 'url';
const kExperimentalLoaderOptions = [
'--no-warnings',
diff --git a/packages/playwright/src/transform/transform.ts b/packages/playwright/src/transform/transform.ts
index 06717dde21..595588d49b 100644
--- a/packages/playwright/src/transform/transform.ts
+++ b/packages/playwright/src/transform/transform.ts
@@ -15,10 +15,10 @@
*/
import crypto from 'crypto';
-import * as fs from 'fs';
+import fs from 'fs';
import Module from 'module';
-import * as path from 'path';
-import * as url from 'url';
+import path from 'path';
+import url from 'url';
import { loadTsConfig } from '../third_party/tsconfig-loader';
import { createFileMatcher, fileIsModule, resolveImportSpecifierAfterMapping } from '../util';
diff --git a/packages/playwright/src/util.ts b/packages/playwright/src/util.ts
index d919ae5be7..53760970bd 100644
--- a/packages/playwright/src/util.ts
+++ b/packages/playwright/src/util.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
-import * as url from 'url';
+import fs from 'fs';
+import path from 'path';
+import url from 'url';
import util from 'util';
import { parseStackFrame, sanitizeForFilePath, calculateSha1, isRegExp, isString, stringifyStackFrames } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/worker/testInfo.ts b/packages/playwright/src/worker/testInfo.ts
index cbb26b6c2f..50fc494bd9 100644
--- a/packages/playwright/src/worker/testInfo.ts
+++ b/packages/playwright/src/worker/testInfo.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { captureRawStack, monotonicTime, sanitizeForFilePath, stringifyStackFrames, currentZone } from 'playwright-core/lib/utils';
diff --git a/packages/playwright/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts
index ba215c8792..4b4390baa3 100644
--- a/packages/playwright/src/worker/testTracing.ts
+++ b/packages/playwright/src/worker/testTracing.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import * as fs from 'fs';
-import * as path from 'path';
+import fs from 'fs';
+import path from 'path';
import { ManualPromise, SerializedFS, calculateSha1, createGuid, monotonicTime } from 'playwright-core/lib/utils';
import { yauzl, yazl } from 'playwright-core/lib/zipBundle';
diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts
index a31bb858d5..a13ec126c4 100644
--- a/packages/playwright/types/test.d.ts
+++ b/packages/playwright/types/test.d.ts
@@ -371,7 +371,7 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
*
* ```js
* import { test, expect } from '@playwright/test';
- * import * as fs from 'fs';
+ * import fs from 'fs';
*
* test('example test', async ({}, testInfo) => {
* const file = testInfo.outputPath('temporary-file.txt');
@@ -1349,7 +1349,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
*
* ```js
* import { test, expect } from '@playwright/test';
- * import * as fs from 'fs';
+ * import fs from 'fs';
*
* test('example test', async ({}, testInfo) => {
* const file = testInfo.outputPath('temporary-file.txt');
@@ -9215,7 +9215,7 @@ export interface TestInfo {
*
* ```js
* import { test, expect } from '@playwright/test';
- * import * as fs from 'fs';
+ * import fs from 'fs';
*
* test('example test', async ({}, testInfo) => {
* const file = testInfo.outputPath('dir', 'temporary-file.txt');
diff --git a/packages/recorder/tsconfig.json b/packages/recorder/tsconfig.json
index 05e3481057..166ee1a010 100644
--- a/packages/recorder/tsconfig.json
+++ b/packages/recorder/tsconfig.json
@@ -5,7 +5,7 @@
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": false,
- "esModuleInterop": false,
+ "esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"module": "ESNext",
diff --git a/packages/recorder/vite.config.ts b/packages/recorder/vite.config.ts
index a72a43f203..17468bdc69 100644
--- a/packages/recorder/vite.config.ts
+++ b/packages/recorder/vite.config.ts
@@ -16,7 +16,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
-import * as path from 'path';
+import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
diff --git a/packages/trace-viewer/vite.config.ts b/packages/trace-viewer/vite.config.ts
index 52b8b8322a..00b367bbc8 100644
--- a/packages/trace-viewer/vite.config.ts
+++ b/packages/trace-viewer/vite.config.ts
@@ -17,7 +17,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { bundle } from './bundle';
-import * as path from 'path';
+import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
diff --git a/packages/trace-viewer/vite.sw.config.ts b/packages/trace-viewer/vite.sw.config.ts
index 3a6caaae32..60e90b96ac 100644
--- a/packages/trace-viewer/vite.sw.config.ts
+++ b/packages/trace-viewer/vite.sw.config.ts
@@ -17,7 +17,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { bundle } from './bundle';
-import * as path from 'path';
+import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({