mirror of https://github.com/status-im/metro.git
metro: collapse name verification into getHasteName()
Reviewed By: rafeca, mjesun Differential Revision: D7196246 fbshipit-source-id: 425573f61148ac3a4e85bbcf4fb1033f3e560dab
This commit is contained in:
parent
091815ea81
commit
de35a73798
|
@ -99,17 +99,15 @@ function transformModule(
|
||||||
|
|
||||||
let hasteID = null;
|
let hasteID = null;
|
||||||
if (filename.indexOf(NODE_MODULES) === -1 && !polyfill) {
|
if (filename.indexOf(NODE_MODULES) === -1 && !polyfill) {
|
||||||
hasteID = docblock.parse(docblock.extract(sourceCode)).providesModule;
|
|
||||||
if (options.hasteImplModulePath != null) {
|
if (options.hasteImplModulePath != null) {
|
||||||
// eslint-disable-next-line no-useless-call
|
// eslint-disable-next-line no-useless-call
|
||||||
const HasteImpl = (require.call(
|
const HasteImpl = (require.call(
|
||||||
null,
|
null,
|
||||||
options.hasteImplModulePath,
|
options.hasteImplModulePath,
|
||||||
): HasteImpl);
|
): HasteImpl);
|
||||||
if (HasteImpl.enforceHasteNameMatches) {
|
hasteID = HasteImpl.getHasteName(filename, sourceCode);
|
||||||
HasteImpl.enforceHasteNameMatches(filename, hasteID);
|
} else {
|
||||||
}
|
hasteID = docblock.parse(docblock.extract(sourceCode)).providesModule;
|
||||||
hasteID = HasteImpl.getHasteName(filename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ type Options = {|
|
||||||
+watch: boolean,
|
+watch: boolean,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
const JEST_HASTE_MAP_CACHE_BREAKER = 2;
|
const JEST_HASTE_MAP_CACHE_BREAKER = 3;
|
||||||
|
|
||||||
class DependencyGraph extends EventEmitter {
|
class DependencyGraph extends EventEmitter {
|
||||||
_assetResolutionCache: AssetResolutionCache;
|
_assetResolutionCache: AssetResolutionCache;
|
||||||
|
|
Loading…
Reference in New Issue