Blacklist modules from being how swapped
Reviewed By: frantic Differential Revision: D3007480 fb-gh-sync-id: b563a9839c37110f7639b3f1db80ac2663d560ba shipit-source-id: b563a9839c37110f7639b3f1db80ac2663d560ba
This commit is contained in:
parent
62177dbb3b
commit
a1821ae523
|
@ -12,6 +12,10 @@ const getInverseDependencies = require('node-haste').getInverseDependencies;
|
|||
const querystring = require('querystring');
|
||||
const url = require('url');
|
||||
|
||||
const blacklist = [
|
||||
'Libraries/Utilities/HMRClient.js',
|
||||
];
|
||||
|
||||
/**
|
||||
* Attaches a WebSocket based connection to the Packager to expose
|
||||
* Hot Module Replacement updates to the simulator.
|
||||
|
@ -124,6 +128,14 @@ function attachHMRServer({httpServer, path, packagerServer}) {
|
|||
`[Hot Module Replacement] File change detected (${time()})`
|
||||
);
|
||||
|
||||
const blacklisted = blacklist.find(path =>
|
||||
filename.indexOf(path) !== -1
|
||||
);
|
||||
|
||||
if (blacklisted) {
|
||||
return;
|
||||
}
|
||||
|
||||
client.ws.send(JSON.stringify({type: 'update-start'}));
|
||||
stat.then(() => {
|
||||
return packagerServer.getShallowDependencies(filename)
|
||||
|
|
Loading…
Reference in New Issue