jest-module-field-resolver
This package is for jest to use packages that don't have main
field in their
package.json.
Usage
-
install the package
$ npm i -D jest-module-field-resolver
-
add
jest-module-field-resolver
as the resolver of jest, andtransformIgnorePattern
so that the package missingmain
field can be transpiled correctly when running jest.In your package.json, please add them as follows:
Note
Ref: https://github.com/facebook/jest/issues/2702#issuecomment-585595612
This is based on https://gist.github.com/loklaan/9fe7768576466c5a31c2e7af4cfdecd0.