Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Add ability to cache-bust based on other files, ex .browserslistrc #121

Open
MagicDuck opened this issue Sep 12, 2022 · 0 comments
Open

Comments

@MagicDuck
Copy link

Changes to .browserlistrc file should invalidate the cache.
Those files can be added in the array that is the first argument to getCacheKeyFunction here:

jest/index.ts

Line 24 in 4c692f0

const cacheKeyFunction = getCacheKeyFunction([], [swcVersion, version, JSON.stringify(computedSwcOptions)])

Not sure if we want to hard code .browserlistrc since it's well known, or allow the list of files to be passed as an option to the jest transform. Ex:

module.exports = {
  transform: {
    '^.+\\.(t|j)sx?$': '@swc/jest',
    cacheBustFiles: [
      path.join(__dirname, '.browserslistrc'),
    ],
  },
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant