Pass local paths to transformers

Summary:
Pass `localPath` to transformers to allow usage of plugins like `transform-react-jsx-source` that don’t conflict with x-machine caches, e.g. Buck or our own global cache.
These caches don’t work properly if paths local to a specific machine are part of cached outputs.

Reviewed By: jeanlauliac

Differential Revision: D5044147

fbshipit-source-id: 1177afb48d6dd9351738fcd4da8f9f6357e25e81
This commit is contained in:
David Aurelio
2017-05-11 16:47:43 -07:00
committed by Facebook Github Bot
parent 143beaf95d
commit 2fbe3b799e
9 changed files with 71 additions and 32 deletions
@@ -72,6 +72,7 @@ function transformModule(
Object.keys(variants).forEach(name => {
tasks[name] = asyncify(() => transformer.transform({
filename,
localPath: filename,
options: {...defaultTransformOptions, ...variants[name]},
src: code,
})