@@ -4,7 +4,6 @@ var webpackDevMiddleware = require("webpack-dev-middleware");
44var express = require ( "express" ) ;
55var compress = require ( "compression" ) ;
66var sockjs = require ( "sockjs" ) ;
7- var StreamCache = require ( "stream-cache" ) ;
87var http = require ( "http" ) ;
98var https = require ( "https" ) ;
109var httpProxyMiddleware = require ( "http-proxy-middleware" ) ;
@@ -35,22 +34,6 @@ function Server(compiler, options) {
3534 this . _stats = stats ;
3635 } . bind ( this ) ) ;
3736
38- // Prepare live html page
39- var livePage = this . livePage = new StreamCache ( ) ;
40- fs . createReadStream ( path . join ( __dirname , ".." , "client" , "live.html" ) ) . pipe ( livePage ) ;
41-
42- // Prepare the live js file
43- var liveJs = new StreamCache ( ) ;
44- fs . createReadStream ( path . join ( __dirname , ".." , "client" , "live.bundle.js" ) ) . pipe ( liveJs ) ;
45-
46- // Prepare the inlined js file
47- var inlinedJs = new StreamCache ( ) ;
48- fs . createReadStream ( path . join ( __dirname , ".." , "client" , "index.bundle.js" ) ) . pipe ( inlinedJs ) ;
49-
50- // Prepare the sockjs js file
51- var sockjsJs = new StreamCache ( ) ;
52- fs . createReadStream ( path . join ( __dirname , ".." , "client" , "sockjs.bundle.js" ) ) . pipe ( sockjsJs ) ;
53-
5437 // Init express server
5538 var app = this . app = new express ( ) ;
5639
@@ -59,23 +42,23 @@ function Server(compiler, options) {
5942
6043 app . get ( "/__webpack_dev_server__/live.bundle.js" , function ( req , res ) {
6144 res . setHeader ( "Content-Type" , "application/javascript" ) ;
62- liveJs . pipe ( res ) ;
45+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "live.bundle.js" ) ) . pipe ( res ) ;
6346 } ) ;
6447
6548 app . get ( "/__webpack_dev_server__/sockjs.bundle.js" , function ( req , res ) {
6649 res . setHeader ( "Content-Type" , "application/javascript" ) ;
67- sockjsJs . pipe ( res ) ;
50+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "sockjs.bundle.js" ) ) . pipe ( res ) ;
6851 } ) ;
6952
7053 app . get ( "/webpack-dev-server.js" , function ( req , res ) {
7154 res . setHeader ( "Content-Type" , "application/javascript" ) ;
72- inlinedJs . pipe ( res ) ;
55+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "index.bundle.js" ) ) . pipe ( res ) ;
7356 } ) ;
7457
7558 app . get ( "/webpack-dev-server/*" , function ( req , res ) {
7659 res . setHeader ( "Content-Type" , "text/html" ) ;
77- this . livePage . pipe ( res ) ;
78- } . bind ( this ) ) ;
60+ fs . createReadStream ( path . join ( __dirname , ".." , "client" , "live.html" ) ) . pipe ( res ) ;
61+ } ) ;
7962
8063 app . get ( "/webpack-dev-server" , function ( req , res ) {
8164 res . setHeader ( "Content-Type" , "text/html" ) ;
0 commit comments