In a monorepo setup, using ESM and TS, jest fails to read correctly the config when exported from a different package.
/**
* Importing the config from a different package doesn't work
* Error: Jest: Failed to parse the TypeScript config file /projects/jest-esmodules/packages/package/jest.config.ts
* Error: Must use import to load ES Module: /projects/jest-esmodules/packages/testing/jest.config.base.ts
*/
import { baseConfig } from "@tfe/testing/jest.config.base";
export default baseConfig;
But when copying the config on each package, it works well
Version
Jest: 29.7.0 Node: 20.15 ts-node: 10.9.2
Steps to reproduce
In a monorepo setup, using ESM and TS, jest fails to read correctly the config when exported from a different package.
But when copying the config on each package, it works well
Added a minimal setup: https://github.com/fallemand/jest-ts-esm-monorepo
Repo to reproduce
Environment