Skip to content

Commit

Permalink
Normalise relative path for transform cache keys - enable remote cach…
Browse files Browse the repository at this point in the history
…e hits

Summary:
Normalise transform cache keys to allow portability between Windows and posix.

```
 - **[Fix]**: Generate the same transform cache keys on Windows and Posix for remote cache portability.
```

Reviewed By: rozele

Differential Revision: D60166699

fbshipit-source-id: 372f9bc49f4288706ee91d28860bd2f5ba5136a7
  • Loading branch information
robhogan authored and facebook-github-bot committed Jul 25, 2024
1 parent 72045a5 commit e3aaa0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/metro/src/DeltaBundler/Transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ class Transformer {
// This is the hash related to the global Bundler config.
this._baseHash,

// Path.
localPath,
// Project-relative, posix-separated path for portability. Necessary in
// addition to content hash because transformers receive path as an
// input, and may apply e.g. extension-based logic.
path.sep === '/' ? localPath : localPath.replaceAll(path.sep, '/'),

customTransformOptions,
dev,
Expand Down

0 comments on commit e3aaa0b

Please sign in to comment.