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:
Martín Bigio 2016-03-09 11:49:40 -08:00 committed by Facebook Github Bot 9
parent 62177dbb3b
commit a1821ae523

View File

@ -12,6 +12,10 @@ const getInverseDependencies = require('node-haste').getInverseDependencies;
const querystring = require('querystring'); const querystring = require('querystring');
const url = require('url'); const url = require('url');
const blacklist = [
'Libraries/Utilities/HMRClient.js',
];
/** /**
* Attaches a WebSocket based connection to the Packager to expose * Attaches a WebSocket based connection to the Packager to expose
* Hot Module Replacement updates to the simulator. * Hot Module Replacement updates to the simulator.
@ -124,6 +128,14 @@ function attachHMRServer({httpServer, path, packagerServer}) {
`[Hot Module Replacement] File change detected (${time()})` `[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'})); client.ws.send(JSON.stringify({type: 'update-start'}));
stat.then(() => { stat.then(() => {
return packagerServer.getShallowDependencies(filename) return packagerServer.getShallowDependencies(filename)