Updates from Thu Sep 3rd.

This commit is contained in:
Spencer Ahrens 2015-09-03 12:55:40 -07:00
commit bad0a5cb46
4 changed files with 9 additions and 6 deletions

View File

@ -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
);

View File

@ -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'),

View File

@ -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);

View File

@ -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();