Compress HTTP responses from the packager

Summary: The packager was adding compression middleware too late in the stack. This makes things a little faster especially if you're loading through dynamic DNS for example.
Closes https://github.com/facebook/react-native/pull/4121

Reviewed By: svcscm

Differential Revision: D2664373

Pulled By: frantic

fb-gh-sync-id: 46cce81ff6d9e4e71e1718d7e96b58449c248bc1
This commit is contained in:
James Ide 2015-11-17 12:20:31 -08:00 committed by facebook-github-bot-6
parent 47b8a0ab7a
commit b838b4617c

View File

@ -25,6 +25,7 @@ function runServer(args, config, readyCallback) {
var wsProxy = null;
const app = connect()
.use(loadRawBodyMiddleware)
.use(connect.compress())
.use(getDevToolsMiddleware(args, () => wsProxy && wsProxy.isChromeConnected()))
.use(openStackFrameInEditorMiddleware)
.use(statusPageMiddleware)
@ -37,7 +38,6 @@ function runServer(args, config, readyCallback) {
args.projectRoots.forEach(root => app.use(connect.static(root)));
app.use(connect.logger())
.use(connect.compress())
.use(connect.errorHandler());
const serverInstance = http.createServer(app).listen(