folke / esbuild-runner

⚡️ Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
https://www.npmjs.com/package/esbuild-runner
Apache License 2.0
710 stars 24 forks source link

feat: add option to specify whether to use cache; do not use cache for jest #51

Open smcenlly opened 2 years ago

smcenlly commented 2 years ago

We discovered an issue using esbuild-runner/jest with our product, Wallaby.js where it was returning old file content for a new transformed file request because the file timestamp (used by the cache) is unchanged.

Jest has its own caching mechanism that is used when the file content is unchanged which means that the caching mechanism should be unnecessary when using jest.

I'm not sure what other contexts esbuild-runner is used, but for the case of jest, I've modified esbuild-runner to not use its internal cache.

smcenlly commented 2 years ago

(Related issue: https://github.com/wallabyjs/public/issues/2946)