cli: only pass through .mjs if ESM is supported
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Only allow pass through of `.mjs` in Jest transform if static ESM is supported.
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user