Skip to content

Commit

Permalink
fix: Specify no-transform to avoid buffering
Browse files Browse the repository at this point in the history
As discussed in #10
  • Loading branch information
glenjamin authored and joshwiens committed Mar 30, 2018
1 parent 2b7defc commit 86ec3cb
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 86ec3cb

Please sign in to comment.