chore: add comment about async imports in babel (#23374)

https://github.com/microsoft/playwright/issues/23255
This commit is contained in:
Max Schmitt 2023-05-31 18:32:09 +02:00 committed by GitHub
parent 2582d3984b
commit 4eeb4655e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')]);