diff --git a/CHANGELOG.md b/CHANGELOG.md index cb909d7841ac..23d5543773f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ - `[jest-haste-map]` Fix the `mapper` option which was incorrectly ignored ([#8299](https://github.com/facebook/jest/pull/8299)) - `[jest-jasmine2]` Fix describe return value warning being shown if the describe function throws ([#8335](https://github.com/facebook/jest/pull/8335)) - `[jest-environment-jsdom]` Re-declare global prototype of JSDOMEnvironment ([#8352](https://github.com/facebook/jest/pull/8352)) -- `[jest-transform]` Replace colons in transform cache filenames to support Windows ([#8353](https://github.com/facebook/jest/pull/8353)) +- `[jest-transform]` Replace special characters in transform cache filenames to support Windows ([#8353](https://github.com/facebook/jest/pull/8353)) ### Chore & Maintenance diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index d1e1c50d1aa0..7748d2cb2439 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -94,7 +94,6 @@ export default class ScriptTransformer { rootDir: this._config.rootDir, }), ) - .update(filename) .update(CACHE_VERSION) .digest('hex'); } else { @@ -125,7 +124,7 @@ export default class ScriptTransformer { const cacheDir = path.join(baseCacheDir, cacheKey[0] + cacheKey[1]); const cacheFilenamePrefix = path .basename(filename, path.extname(filename)) - .replace(/:/g, '_COLON_'); + .replace(/\W/g, ''); const cachePath = slash( path.join(cacheDir, cacheFilenamePrefix + '_' + cacheKey), );