mkg0 / jest-webpack-resolver

path resolver for jest through the webpack.config. Auto detect webpack's resolve properties like aliases, plugins and more
44 stars 6 forks source link

Cache resolved paths #13

Closed evanc closed 6 years ago

evanc commented 6 years ago

I noticed that this plugin was slower than I would have expected. The exported function is run with the same inputs over and over, and I believe those can be cached without losing anything.

I'm making an assumption here, that people's webpack configs won't be changing while they're running tests. This seems like a safe assumption but I could be wrong.

mkg0 commented 6 years ago

thank you for PR. It works like a charm! But I prefer to handle caching with webpack's resolver. So I implemented CachedInputFileSystem of enhanced-resolve.

https://github.com/mkg0/jest-webpack-resolver/pull/14

above pr should resolve the issue. If we still face performance problems we can try this kind of ways to improve caching.