on-internet
← Community

Lazy-load imports from barrel file in Jest

Stack Overflow ·

I'm using React and have a file tree like this: src/ common/ common-comp1/ common-comp1.js common-comp1.test.js index.js common-comp2/ common-comp2.js common-comp2.test.js index.js index.js app/ app-comp1/ app-comp1.js app-comp1.test.js index.js app-comp2/ app-comp2.js app-comp2.test.js index.js index.js All of the index.js files are barrel files that export * from '...';. I have path aliases set up so that I can import CommonComp1 from 'common'; in src/app/app-comp1/app-comp1.js. Unfortunately, this loads/transforms the code from src/common/common-comp2/* as well, even though app-comp1.js doe

Comments

Sign in or sign up to comment and upvote.

No comments yet.