playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature] Support adding custom loaders to the test runner

Open AlessioGr opened this issue 2 years ago • 2 comments

Ever since switching from CJS to ESM, we've needed a custom node loader to process .scss, .svg and png file imports.

For playwright, we had to create a patch file which patches playwright to point to our custom loader.

Without this loader, we'd get the following error: Screenshot 2023-08-31 at 19 33 25@2x

Instead of us having to patch playwright, could you either

  • add a config option which allows us to add custom node loaders here, or
  • natively support scss/svg/png imports in playwright's own loader?

AlessioGr avatar Aug 31 '23 17:08 AlessioGr

any update on this ?

hpierre74 avatar Feb 12 '24 12:02 hpierre74

Also looking for an update on this one. We've patched this here:

https://github.com/payloadcms/payload/blob/alpha/patches/playwright%401.42.1.patch

But would love to sunset our reliance on patching Playwright.

Thank you!

jmikrut avatar Mar 11 '24 21:03 jmikrut

Currently running into this issue in our monorepo. It'd be nice to be able to use tsx to overcome the ESM/CJS module hell in Playwright.

divmgl avatar Mar 22 '24 14:03 divmgl