Skip to content

Commit

Permalink
[chore] Update client location and serve minified file (#2766)
Browse files Browse the repository at this point in the history
Following socketio/socket.io-client#1025, the
output files are now generated in the dist directory.
  • Loading branch information
darrachequesne committed Nov 27, 2016
1 parent 9c23308 commit 3c98130
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Expand Up @@ -98,9 +98,9 @@ Server.prototype.serveClient = function(v){
this._serveClient = v;

if (v && !clientSource) {
clientSource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8');
clientSource = read(require.resolve('socket.io-client/dist/socket.io.min.js'), 'utf-8');
try {
clientSourceMap = read(require.resolve('socket.io-client/socket.io.js.map'), 'utf-8');
clientSourceMap = read(require.resolve('socket.io-client/dist/socket.io.js.map'), 'utf-8');
} catch(err) {
debug('could not load sourcemap file');
}
Expand Down Expand Up @@ -304,6 +304,7 @@ Server.prototype.serve = function(req, res){
debug('serve client source');
res.setHeader('Content-Type', 'application/javascript');
res.setHeader('ETag', expectedEtag);
res.setHeader('X-SourceMap', 'socket.io.js.map');
res.writeHead(200);
res.end(clientSource);
};
Expand Down

0 comments on commit 3c98130

Please sign in to comment.