Introduce HasteImpl

Summary:
Similar to https://github.com/facebook/jest/pull/2877, this introduces an optional config `HasteImpl` of type `{getHasteName(filePath: string): (string|void)}` that returns the haste name for a module at filePath if it is a haste module or undefined otherwise.

This allows us to inject a custom implementation of haste's module id resolution rather than only relying on `providesModule` annotations

Reviewed By: davidaurelio

Differential Revision: D4589372

fbshipit-source-id: 4d1983dfbf09c9d67faf725e86ae86ab42433b7d
This commit is contained in:
Bhuwan Khattar
2017-02-27 10:48:17 -08:00
committed by Facebook Github Bot
parent 4ba983401f
commit 234f4f538d
9 changed files with 75 additions and 18 deletions

View File

@@ -29,6 +29,7 @@ function dependencies(argv, config, args, packagerInstance) {
projectRoots: config.getProjectRoots(),
blacklistRE: config.getBlacklistRE(),
getTransformOptions: config.getTransformOptions,
hasteImpl: config.hasteImpl,
transformModulePath: transformModulePath,
extraNodeModules: config.extraNodeModules,
verbose: config.verbose,