Skip to content

Commit 77cbf72

Browse files
glenjaminjoshwiens
authored andcommitted
fix: Specify no-transform to avoid buffering
As discussed in #10
1 parent ff48df4 commit 77cbf72

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ Configuration options can be passed to the client by adding querystring paramete
7676
* **overlay** - Set to `false` to disable the DOM-based client-side overlay.
7777
* **reload** - Set to `true` to auto-reload the page when webpack gets stuck.
7878

79+
## How it Works
80+
81+
The middleware installs itself as a webpack plugin, and listens for compiler events.
82+
83+
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.
84+
85+
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.
86+
7987
## License
8088
8189
Copyright 2015 Glen Mailer.

middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function createEventStream(heartbeat) {
5050
res.writeHead(200, {
5151
'Access-Control-Allow-Origin': '*',
5252
'Content-Type': 'text/event-stream;charset=utf-8',
53-
'Cache-Control': 'no-cache',
53+
'Cache-Control': 'no-cache, no-transform',
5454
'Connection': 'keep-alive'
5555
});
5656
res.write('\n');

0 commit comments

Comments
 (0)