This appears to be caused by the order of elements in the jest configuration option for moduleFileExtensions
. The nx jest preset configures this to list ts
first. Moving ts
to be after js
and mjs
solves the problem.
I added this to the jest.config.ts
in my nx “javascript” library to get the workflow bundling working.
moduleFileExtensions: ['js', 'mjs', 'ts', 'html'],