Merge pull request #28693 from backstage/rugvip/static

cli: only pass through .mjs if ESM is supported
This commit is contained in:
Patrik Oldsberg
2025-01-31 16:17:36 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Only allow pass through of `.mjs` in Jest transform if static ESM is supported.
+1 -1
View File
@@ -29,7 +29,7 @@ function createTransformer(config) {
}
// Skip transformation of .mjs files, they should only be used if ESM support is available
if (filePath.endsWith('.mjs')) {
if (jestOptions.supportsStaticESM && filePath.endsWith('.mjs')) {
return { code: source };
}