diff --git a/react-packager/src/Server/__tests__/Server-test.js b/react-packager/src/Server/__tests__/Server-test.js index da8e803f..d9ec6dbe 100644 --- a/react-packager/src/Server/__tests__/Server-test.js +++ b/react-packager/src/Server/__tests__/Server-test.js @@ -126,7 +126,7 @@ describe('processRequest', () => { expect(Bundler.prototype.bundle).toBeCalledWith( 'index.js', true, - 'index.map', + 'index.map?platform=ios', true, 'ios', ); @@ -271,7 +271,7 @@ describe('processRequest', () => { expect(Bundler.prototype.bundle).toBeCalledWith( 'path/to/foo.js', false, - '/path/to/foo.map', + '/path/to/foo.map?dev=false&runModule=false', false, undefined ); diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index 1ad6d862..d727fd52 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -429,8 +429,11 @@ class Server { return true; }).join('.') + '.js'; + const sourceMapUrlObj = _.clone(urlObj); + sourceMapUrlObj.pathname = pathname.replace(/\.bundle$/, '.map'); + return { - sourceMapUrl: pathname.replace(/\.bundle$/, '.map'), + sourceMapUrl: url.format(sourceMapUrlObj), entryFile: entryFile, dev: this._getBoolOptionFromQuery(urlObj.query, 'dev', true), minify: this._getBoolOptionFromQuery(urlObj.query, 'minify'), diff --git a/react-packager/src/SocketInterface/SocketServer.js b/react-packager/src/SocketInterface/SocketServer.js index d3cb752d..b292b2bf 100644 --- a/react-packager/src/SocketInterface/SocketServer.js +++ b/react-packager/src/SocketInterface/SocketServer.js @@ -15,7 +15,7 @@ const debug = require('debug')('ReactPackager:SocketServer'); const fs = require('fs'); const net = require('net'); -const MAX_IDLE_TIME = 10 * 60 * 1000; +const MAX_IDLE_TIME = 30 * 1000; class SocketServer { constructor(sockPath, options) { @@ -118,7 +118,7 @@ class SocketServer { this._deathTimer = setTimeout(() => { if (this._jobs <= 0) { debug('server dying', process.pid); - process.exit(1); + process.exit(); } this._dieEventually(); }, MAX_IDLE_TIME); diff --git a/react-packager/src/lib/getCacheFilePath.js b/react-packager/src/lib/getCacheFilePath.js index d5ef19b3..1d858529 100644 --- a/react-packager/src/lib/getCacheFilePath.js +++ b/react-packager/src/lib/getCacheFilePath.js @@ -12,7 +12,7 @@ const crypto = require('crypto'); const path = require('path'); const tmpdir = require('os').tmpDir(); -function getCacheFilePath(args) { +function getCacheFilePath(...args) { args = Array.prototype.slice.call(args); const prefix = args.shift();