From 4eeb4655e913391976de9e4c0ce0c73fc567d928 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 31 May 2023 18:32:09 +0200 Subject: [PATCH] chore: add comment about async imports in babel (#23374) https://github.com/microsoft/playwright/issues/23255 --- packages/playwright-test/bundles/babel/src/babelBundleImpl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts b/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts index 2a9b246248..c71f24eec3 100644 --- a/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts +++ b/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts @@ -70,6 +70,7 @@ function babelTransformOptions(isTypeScript: boolean, isModule: boolean, plugins if (!isModule) { plugins.push([require('@babel/plugin-transform-modules-commonjs')]); + // This converts async imports to require() calls so that we can intercept them with pirates. plugins.push([require('@babel/plugin-proposal-dynamic-import')]); } else { plugins.push([require('@babel/plugin-syntax-import-assertions')]);