Skip to content

Commit

Permalink
Specify no-transform to avoid buffering the response
Browse files Browse the repository at this point in the history
As discussed in #10
  • Loading branch information
glenjamin committed Sep 8, 2015
1 parent b2d4274 commit a741c07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ Configuration options can be passed to the client by adding querystring paramete
* **overlay** - Set to `false` to disable the DOM-based client-side overlay.
* **reload** - Set to `true` to auto-reload the page when webpack gets stuck.

## How it Works

The middleware installs itself as a webpack plugin, and listens for compiler events.

Each connected client gets a [Server Sent Events](http://www.html5rocks.com/en/tutorials/eventsource/basics/) connection, the server will publish notifications to connected clients on compiler events.

When the client receives a message, it will check to see if the local code is up to date. If it isn't up to date, it will trigger webpack hot module reloading.
## License
Copyright 2015 Glen Mailer.
Expand Down
2 changes: 1 addition & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function createEventStream(heartbeat) {
res.writeHead(200, {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'text/event-stream;charset=utf-8',
'Cache-Control': 'no-cache',
'Cache-Control': 'no-cache, no-transform',
'Connection': 'keep-alive'
});
res.write('\n');
Expand Down

0 comments on commit a741c07

Please sign in to comment.