Metro HMR: Add file parameter to getShallowDependencies()

Reviewed By: jeanlauliac

Differential Revision: D5687991

fbshipit-source-id: c2db3986c6a5ec81ed1350ded92dfcf1b529c2bc
This commit is contained in:
Rafael Oleza 2017-08-24 08:15:57 -07:00 committed by Facebook Github Bot
parent f266ab9bac
commit 0b17524134

View File

@ -38,6 +38,7 @@ type DependencyOptions = {|
+minify: boolean, +minify: boolean,
+platform: ?string, +platform: ?string,
+recursive: boolean, +recursive: boolean,
+rootEntryFile: string,
|}; |};
/** /**
@ -113,6 +114,7 @@ function attachHMRServer<TModule: Moduleish>(
const response = await packagerServer.getDependencies({ const response = await packagerServer.getDependencies({
dev: true, dev: true,
entryFile: bundleEntry, entryFile: bundleEntry,
rootEntryFile: bundleEntry,
hot: true, hot: true,
minify: false, minify: false,
platform: platform, platform: platform,
@ -137,6 +139,7 @@ function attachHMRServer<TModule: Moduleish>(
const dependencies = await packagerServer.getShallowDependencies({ const dependencies = await packagerServer.getShallowDependencies({
dev: true, dev: true,
entryFile: dep.path, entryFile: dep.path,
rootEntryFile: bundleEntry,
hot: true, hot: true,
minify: false, minify: false,
platform: platform, platform: platform,
@ -249,6 +252,7 @@ function attachHMRServer<TModule: Moduleish>(
dev: true, dev: true,
minify: false, minify: false,
entryFile: filename, entryFile: filename,
rootEntryFile: client.bundleEntry,
hot: true, hot: true,
platform: client.platform, platform: client.platform,
recursive: true, recursive: true,
@ -269,6 +273,7 @@ function attachHMRServer<TModule: Moduleish>(
const response = await packagerServer.getDependencies({ const response = await packagerServer.getDependencies({
dev: true, dev: true,
entryFile: filename, entryFile: filename,
rootEntryFile: client.bundleEntry,
hot: true, hot: true,
minify: false, minify: false,
platform: client.platform, platform: client.platform,